I think this problem has got worse with 1.1.7 because as time goes on, Logback is being changed to execute tasks using a per-context ExecutorService backed by a 2-thread pool.
We use a central log server that both receives log events from other processes (through a SimpleSocketServer) and can forward those log events to other consumers (using a ServerSocketAppender). (The consumers are usually standalone log panels, running on different machines.)
In our scenario the problem is that the task that accepts new connections to the ServerSocketAppender is submitted to the context executor. ServerSocketAppender extends AbstractServerSocketAppender, which does:
and you can see this in a thread dump:
When a connection to the ServerSocketAppender is accepted, the task for that connection is also submitted to the context executor. In ConcurrentServerRunner:
and this task can also be seen in a thread dump:
With one client connected, two long-running tasks are being executed by the executor, meaning both threads in the pool are busy, and new tasks that are submitted will be queued, but not executed immediately.
Log file compression is also a task that gets submitted to the executor. From Compressor:
So one client connected to a ServerSocketAppender means that log files won't be compressed when they are rolled over.
I'll attach an example config that can be used to test this.
|