-
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
interruptOnTimeout doesn't work in Hystrix 1.4.0-RC5 #354
Comments
@aadeon This is a bug, but I think the fix has to be made in conjunction with RxJava. I talked to @benjchristensen this morning, and there is some active work around thread interruption happening in RxJava at the moment. Right now, RxJava is unilaterally deciding to do thread interruption on an unsubscribe. IIRC, up until 1.02, the choice was to do it, and for 1.0.3+, the choice was not to. The point is that there's currently no way for Hystrix to specify this decision on a per-instance basis. As @benjchristensen make progress on this interaction, I'll put notes here. In order to not hold up RC6, I'm now targeting this to RC7 |
I now have a tentative fix for this issue that respects the property value on whether or not to interrupt the underlying thread, and am awaiting feedback on it. I think the interaction between Hystrix and Rx could be improved and want to see what options there are before committing to the version in #593 |
Currently, we interrupt a ScheduledAction if the unsubscription was called from a different thread the action is running on. If it was called from the same thread, we cancel the underlying future without interruption. This saves us some time for normally completing actions. @abersnaze's PR was no-op in RxJava but the associated test change suggests there is a custom Scheduler involved which doesn't track its active tasks so unsubscribing its worker doesn't cancel the scheduled tasks. I'm not familiar with how Hystrix interacts with RxJava. |
Fixed in #647 |
When using Hystrix 1.4.0-RC5, the commands are not interrupted when the command times out.
The following naive test shows how to reproduce this:
It works fine with Hystrix 1.3.18.
The text was updated successfully, but these errors were encountered: