-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Timeout handling fails for non-idempotent strategy #351
Comments
Here's what's happening: In the case where you're calling
In the case where you're calling
Generalizing, working with I don't think that's there's a reasonable change to make within Hystrix, just the recommendation to prefer |
Thank you for explanation, I got the message about avoid to use ThreadLocal, but unfortunately we're stick to Guice DI, which is rely on ThreadLocal internally. Calling Hystrix Concurrency Strategy twice over main thread, makes Guice throw IllegalStateException. I wonder how to prevent this case, please advice. We just moved up to patched version (from 1.3.9 to 1.3.16) and broke up our concept. |
@krutsko I wanted to let you know I saw this. I don't have a great answer for you off the top of my head. I will think about it and get back to you |
@krutsko I believe the only solution is to have an idempotent HystrixConcurrencyStrategy. On your example, instead of failing if you found a ThreadLocal already set, you could clear it. I'll add a comment to the HystrixConcurrencyStrategy Javadoc around this point. |
yeah, I'm using this workaround in my strategy now. thanks @mattrjacobs |
Added comment in #665 with a pointer back here. |
This was based on the discussion in Netflix#351. I've modified the original example to be compatible with JDK 6, removed the dependency to ICU and refactored the test class to be part of the command class to match the pattern used for other examples.
hi,my use case is to run 5 threads doing separate network calls ,which ever thread get data first ,it should display the data ,i am using HystrixObservableCommand ,but i am getting synchronous execution ,can anyone help me how to achieve asynchronous execution using hystrics |
@tatini1 This issue sounds completely different than the issue you commented on. Can you please open a new issue with details on what you're trying to achieve and what you're observing? |
Recetly we tried to migrate from Hystrix 1.3.9 to the later one 1.3.16 and faced with issue that our custom Hystrix Strategy is not working properly after Hystrix Command throw a Timeout Exception.
I did some modification on this #212 (comment) to show up issue. (In the our real strategy, we use a Guice to propagate http request scope instances
ServletScopes.scopeRequest(actual, seedMap)
which throw IllegalStateException if called twice)I'm not sure to consider this a real issue, so reject if needed.
Exptected: timeout exception.
Actual: IllegalStateException
The text was updated successfully, but these errors were encountered: