java.util.concurrent.RejectedExecutionException with fallback enabled

604 views
Skip to first unread message

Alex M

unread,
Mar 24, 2016, 1:50:10 PM3/24/16
to HystrixOSS
I have a hystrix command that is configured to run in semaphore isolation strategy. Configuration is below

I get an exception 

````
com.netflix.hystrix.exception.HystrixRuntimeException: LocationCircuitBreaker could not be queued for execution and fallback disabled.
at com.netflix.hystrix.AbstractCommand.getFallbackOrThrowException(AbstractCommand.java:843) ~[hystrix-core-1.5.1.jar:1.5.1]
````
which is caused by

````
Caused by: java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@50e8320e rejected from java.util.concurrent.ThreadPoolExecutor@56c3627f[Running, pool size = 10, active threads = 10, queued tasks = 0, completed tasks = 64986]
````

````
hystrix.command.default.execution.isolation.strategy=SEMAPHORE
hystrix.command.default.execution.timeout.enabled=false
hystrix.command.default.execution.isolation.strategy=SEMAPHORE
hystrix.command.default.execution.timeout.enabled=false
hystrix.command.LocationCircuitBreaker.execution.isolation.semaphore.maxConcurrentRequests=1024
hystrix.command.LocationCircuitBreaker.circuitBreaker.forceOpen=true
hystrix.command.LocationCircuitBreaker.fallback.enabled=true
hystrix.command.LocationCircuitBreaker.circuitBreaker.forceClosed=false
hystrix.command.LocationCircuitBreaker.circuitBreaker.errorThresholdPercentage=50
hystrix.command.LocationCircuitBreaker.circuitBreaker.sleepWindowInMilliseconds=5000
hystrix.command.LocationCircuitBreaker.circuitBreaker.requestVolumeThreshold=20
````

Why is there such a "could not be queued for execution and fallback disabled" exception when fallback is enabled and the circuit breaker is forced open? Why is there a thread pool of 10 rejection exception the cause of it when the command is supposed to be using Semaphore isolation?

Matt Jacobs

unread,
Mar 25, 2016, 12:31:47 PM3/25/16
to HystrixOSS
Based on this stack trace, I would say that your configuration is not taking effect.  If you add a breakpoint (or logging if in a real environment) somewhere in your command execution, you should be able to determine what the actual values for isolation strategy and fallback enabled/disabled? are.  

-Matt
Reply all
Reply to author
Forward
0 new messages