I identified a potential flaw in the implementation of Disruptor.shutdown:
public void shutdown()
{
try
{
shutdown(-1, TimeUnit.MILLISECONDS);
}
catch (final TimeoutException e)
{
exceptionHandler.handleOnShutdownException(e);
}
}
The -1 parameter is interpreted as an infinite timeout, which aligns with the method's comments. As a result, TimeoutException will never be thrown and the handleOnShutdownException callback will never be invoked.
To resolve this, I suggest removing the try / catch block.
If needed, I can create a pull request with the changes.