You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating and registering a custom HystrixConcurrencyStrategy, I noticed two things.
For semaphore based calls, wrapCallable() is getting called once, but the wrapped callable's call() method is never getting called.
For thread based calls, wrapCallable() is getting called twice, but the wrapped callable's call() method is only getting invoked on the second wrapped callable.
I've attached a simple maven project (hopefully boiled down enough) that uses print statements to highlight these calls as well as some of the other interesting events that occur in both a semaphore based call and a thread based call.
My concern is that calling wrapCallable twice for thread based calls makes it more difficult to manage internal state because the strategy is not sure which call they're on, or if the wrapped callable they're creating is actually going to get called or not.
Also, from a performance perspective, it seems unnecessary to call wrapCallable if the resulting wrapped callable won't be used.
For semaphore-isolation, only the 2nd is occurring.
I believe that there's an optimization to be done here to only create the HystrixContextRunnable for the timeout-handler if a timeout actually occurs. I'll investigate that.
When creating and registering a custom
HystrixConcurrencyStrategy
, I noticed two things.wrapCallable()
is getting called once, but the wrapped callable'scall()
method is never getting called.wrapCallable()
is getting called twice, but the wrapped callable'scall()
method is only getting invoked on the second wrapped callable.I've attached a simple maven project (hopefully boiled down enough) that uses print statements to highlight these calls as well as some of the other interesting events that occur in both a semaphore based call and a thread based call.
My concern is that calling
wrapCallable
twice for thread based calls makes it more difficult to manage internal state because the strategy is not sure which call they're on, or if the wrapped callable they're creating is actually going to get called or not.Also, from a performance perspective, it seems unnecessary to call
wrapCallable
if the resulting wrapped callable won't be used.hystrix-concurrency.zip
The text was updated successfully, but these errors were encountered: