I was just looking at the AsyncLoggerDistruptor#stop() and figured out that
the shutdown time is not configurable and it even could be blocking forever
waiting that the Disruptor backlog has been processed.


// Calling Disruptor.shutdown() will wait until all enqueued events are
fully processed,
// but this waiting happens in a busy-spin. To avoid (postpone) wasting CPU,
// we sleep in short chunks, up to 10 seconds, waiting for the ringbuffer
to drain.
for (int i = 0; hasBacklog(temp) && i < MAX_DRAIN_ATTEMPTS_BEFORE_SHUTDOWN;
i++) {
try {
Thread.sleep(SLEEP_MILLIS_BETWEEN_DRAIN_ATTEMPTS); // give up the CPU for a
while
} catch (final InterruptedException e) { // ignored
}
}
temp.shutdown(); // busy-spins until all events currently in the disruptor
have been processed


I was wondering why the "temp.shutdown()" call does not use a
(configurable) timeout?
Was this a design decision or was it just overlooked?

Br,
DavidL

Reply via email to