Hello,

I've been taking a look at LoggerContext#stop() and for what I see there's
code to prevent disruptor to take new messages but there's nothing making
sure that the ring buffer is empty before actually closing up.

I did a simple test with an Appender wrapper like this:

final class StopConditionSafeAppenderWrapper extends BaseAppenderWrapper
{
    private final LoggerContext loggerContext;

    StopConditionSafeAppenderWrapper(Appender delegate, LoggerContext
loggerContext)
    {
        super(delegate);
        this.loggerContext = loggerContext;
    }

    @Override
    public void append(LogEvent event)
    {
        if (!loggerContext.isStarted()) {
             return;
        }

        super.append(event);
    }
}

Using this appender wrapper I still get the same error, because at the time
that append was closed the context was started but by the time disruptor
processed it it was already stopped (this I could verify with a debugger).

Should I open a bug? Any workaround you could suggest?

Thanks!

Reply via email to