Hystrix icon indicating copy to clipboard operation
Hystrix copied to clipboard

1.4: make sure not scheduling fallback on Hystrix thread pool

Open benjchristensen opened this issue 12 years ago • 2 comments

Need to confirm with all the changes that we are not scheduling the fallback on the Hystrix thread pool.

benjchristensen avatar Sep 01 '14 17:09 benjchristensen

(HystrixObservableCommand) - private Observable getFallbackWithProtection() uses a TryableSemaphore to enforce that only one fallback is executed concurrently (therefore no thread pool scheduling).

private Observable getFallbackOrThrowException uses getFallbackWithProtection() under the covers.

The AbstractHystrixCommand implementations: BatchHystrixCommand and GenericCommand both delegate to the CommandAction to handle the fallback execution, which uses CommandExecutor.execute for the commands provided. This propagates down to the AbstractHystrixCommandFactory create, which sets the threadPoolKey based upon MetaHolder defaultGroupKey.

KoltonAndrus avatar Sep 17 '14 20:09 KoltonAndrus

I also confirmed this. Fallbacks for timeouts are running on the HystrixTimer thread. They run on the main thread in other cases. There are unit tests asserting this.

benjchristensen avatar Sep 25 '14 00:09 benjchristensen