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.13k stars 4.71k forks source link

HystrixTimer when it initialize ScheduledThreadPoolExecutor does not set RemoveOnCancelPolicy for true #1998

Open lovingcodesk opened 4 years ago

lovingcodesk commented 4 years ago

set follow configurations for some command key:

hystrix.command.fallbackcmd.execution.isolation.thread.timeoutInMilliseconds = 1000000000 hystrix.command.fallbackcmd.execution.isolation.strategy = SEMAPHORE hystrix.command.fallbackcmd.execution.isolation.semaphore.maxConcurrentRequests = 1000 hystrix.command.fallbackcmd.fallback.enabled = true hystrix.command.fallbackcmd.circuitBreaker.enabled = true

when it invoke TimerReference.clear(), it does not remove this thread from the queue in ScheduledThreadPoolExecutor,In the case of a large number of requests for long time under this hystrix command key will cause memory leak ,we encounter this problem at our production environment,it Influences service performance