Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow in RedisResult[List[(K, V)]] #104

Closed
buntec opened this issue Aug 7, 2023 · 2 comments · Fixed by #105
Closed

Stack overflow in RedisResult[List[(K, V)]] #104

buntec opened this issue Aug 7, 2023 · 2 comments · Fixed by #105

Comments

@buntec
Copy link
Contributor

buntec commented Aug 7, 2023

Looks like https://github.com/davenverse/rediculous/blob/main/core/shared/src/main/scala/io/chrisdavenport/rediculous/RedisResult.scala#L125-L144 isn't stack safe and can fail for large lists (this happened to me).

@armanbilge
Copy link
Contributor

armanbilge commented Aug 7, 2023

Yeah, here's the recursive call to pairs in a non-tail position.

kvs <- pairs(xs)
} yield (k, v) :: kvs

Since this is Either this may have to be rewritten with tailRecM from Cats 🤔

Or on second thought, if tailRecM is possible it should be possible to just manually write a tail recursive function.

@buntec
Copy link
Contributor Author

buntec commented Aug 7, 2023

@buntec buntec mentioned this issue Aug 7, 2023
@armanbilge armanbilge linked a pull request Nov 20, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants