Skip to content

handleOnShutdownException might never be invoked in shutdown #501

@ocoanet

Description

@ocoanet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions