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

hsytrixTimer.addTimeListener,the method submit a scheduled runnable is not use hystrix concurrent strategy #1978

Open fengyapeng opened 4 years ago

fengyapeng commented 4 years ago

`

 public Reference<TimerListener> addTimerListener(final TimerListener listener) {

  startThreadIfNeeded();

    // add the listener
    Runnable r = new Runnable() {
        @Override
        public void run() {
            try {
                listener.tick();
            } catch (Exception e) {
                logger.error("Failed while ticking TimerListener", e);
            }
        }
    };

    ScheduledFuture<?> f = executor.get().getThreadPool().scheduleAtFixedRate(r, listener.getIntervalTimeInMilliseconds(), listener.getIntervalTimeInMilliseconds(), TimeUnit.MILLISECONDS);
    return new TimerReference(listener, f);
}

`

the Runnable not belong to HystrixContextRunnable's instance . So, I cant to add something like "MDC of slf4j" for tracing event notify.