Netflix / Hystrix

Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
24.08k stars 4.7k forks source link

could not acquire a semaphore for execution #1951

Open xiaominger opened 5 years ago

xiaominger commented 5 years ago

it is my zuul config:

 hystrix.command.default.execution.timeout.enabled=false
hystrix.command.default.fallback.enabled = false
hystrix.command.default.circuitBreaker.enabled = false

zuul.semaphore.max-semaphores=50

hystrix.command.default.execution.isolation.semaphore.maxConcurrentRequests=50
zuul.ribbonIsolationStrategy= SEMAPHORE
hystrix.command.default.execution.isolation.strategy=SEMAPHORE

when I restart the tomcat,and the tps is 50, sometimes it reports:

Caused by: java.lang.RuntimeException: could not acquire a semaphore for execution
        at com.netflix.hystrix.AbstractCommand.handleSemaphoreRejectionViaFallback(AbstractCommand.java:966)

then it runs without the error log,it is ok. why?

bltb commented 5 years ago

Hi @xiaominger, this could explain why

https://github.com/Netflix/Hystrix/wiki/How-it-Works#5-is-the-thread-poolqueuesemaphore-full

xiaominger commented 5 years ago

Hi @xiaominger, this could explain why

https://github.com/Netflix/Hystrix/wiki/How-it-Works#5-is-the-thread-poolqueuesemaphore-full

but why is it ok soon