-
Notifications
You must be signed in to change notification settings - Fork 309
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
The client freezes when timeout is reached. #217
Comments
As I see from the stack trace, this is when closing the backend (and the client)? Could you share some code which would reproduce the issue? |
Sorry for the delayed response, it seems that the problem occurs only when using This code hangs infinitely
This code works as expected, the timeout is raised then the app is terminated
To test locally I used your |
Hi, I'm working with @walmaaoui . After further investigation, it seems related to The release code of the resource is executed by the same thread that throws the A workaround we've just found is to shift the call to
So, this issue doesn't seem related to sttp but to the usage of What do you think ? |
Thanks @YannMoisan & @walmaaoui for the investigation - nice find! :) Btw. take a look at:
I think a solution might be to |
I'm more and more convinced that the |
If I understand correctly, the So, if we shift after
|
@YannMoisan ah yes, if there's an exception, the shifting never happens. So I think both should be done: shifting after the action, and in case of an exception, before the close? |
Both can be done by sttp, if the cats backend takes a context shift I suppose |
Or maybe |
I don't know if we can do it in sttp due to the signature : It's possible to write a helper that shift the release code. I don't know if it could be interesting to have that in cats-effect.
|
Maybe I'm missing something, but isn't the root of the problem that you end up calling |
You're right ! I've just tested with |
…tty/okhttp thread pools when using cats-effect/monix
Should be fixed in 1.6.0: https://github.com/softwaremill/sttp/releases/tag/v1.6.0 |
The client freeze infinitely when timeout is reached after raising
java.lang.IllegalStateException: HashedWheelTimer.stop() cannot be called from TimerTask
.We tested sttp 1.5.1 and 1.5.17 and we had the issue with both of them.
We are on scala 2.11 and we use these dependencies:
The text was updated successfully, but these errors were encountered: