The TCP connection is closed in TcpSendingEventHandler#onShutdown (see https://github.com/logstash/logstash-logback-encoder/blob/logstash-logback-encoder-6.6/src/main/java/net/logstash/logback/appender/AbstractLogstashTcpSocketAppender.java#L644-L649). This method - part of the Disruptor LifecycleAware interface - is invoked by the Disruptor when it is shutdown.
When shutdown, the Disruptor first waits during a configurable period of time until all events are processed. If some events remain in the buffer after this period is elapsed, it throws a TimeoutException and the shutdown sequence is aborted. In this scenario the onShutdown method of the TcpEventHandler is not invoked and the connection remains open.
The TCP connection is closed in
TcpSendingEventHandler#onShutdown(see https://github.com/logstash/logstash-logback-encoder/blob/logstash-logback-encoder-6.6/src/main/java/net/logstash/logback/appender/AbstractLogstashTcpSocketAppender.java#L644-L649). This method - part of the DisruptorLifecycleAwareinterface - is invoked by the Disruptor when it is shutdown.When shutdown, the Disruptor first waits during a configurable period of time until all events are processed. If some events remain in the buffer after this period is elapsed, it throws a TimeoutException and the shutdown sequence is aborted. In this scenario the
onShutdownmethod of the TcpEventHandler is not invoked and the connection remains open.