Skip to content

Shutting down the Disruptor with pending events in the buffer causes high CPU usage #566

@brenuart

Description

@brenuart

Calling Disruptor#shutdown() waits until all enqueued events are processed by all registered processors. This happens in a busy spin which causes a high CPU load (see https://github.com/LMAX-Exchange/disruptor/blob/3.4.4/src/main/java/com/lmax/disruptor/dsl/Disruptor.java#L451-L463).

Instead the AsyncDisruptorAppender should implement its own graceful shutdown of the Disruptor with its own wait strategy then ask for an immediate shutdown of the Disruptor when the grace period is over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions