Although I'm not sure if this is the source of my issue, I can reproduce
the state by creating a unit test that causes a RuntimeException and/or
Error to be thrown by a filter that is processing an event.

In OrderedThreadPoolExecutor's Worker, this snippet causes the Worker to be
removed, but the idleWorker count to be increased in such a scenario.
Should the first try/finally block be removed perhaps (causing idleWorkers
to be increased only if runTasks didn't throw anything?

        try {
            if (session != null) {
                runTasks(getSessionTasksQueue(session));
            }
        } finally {
            idleWorkers.incrementAndGet();
        }
    }
} finally {
    synchronized (workers) {
        workers.remove(this);
        OrderedThreadPoolExecutor.this.completedTaskCount +=
completedTaskCount.get();
        workers.notifyAll();
    }
}


On Tue, 11 Jan 2022 at 15:41, Guus der Kinderen <[email protected]>
wrote:

> Hello,
>
> This was found with MINA 2.1.3. Is this a bug? I stumbled upon this while
> performing analysis of heap dumps of a JVMs that suffered from an issue
> where no user was able to establish a connection to our server software
> anymore.
>
> Our application uses an ExecutorFilter. The OrderedThreadPoolExecutor of
> the affected server seems to be in an inconsistent state:
>
>    - idleWorkers: 2
>    - waitingSessions.count: 2293
>    - workers.map.size: 0
>
> I will attempt to include a screenshot of the profiler that holds more
> data (if the mailinglist allows me).
>
> What strikes me as odd is:
>
>    - No workers, while there are sessions waiting to be processed
>    - No workers, but a non-zero idle workers count
>
> Servers that are unaffected by the issue have an idle worker count that is
> equal to the amount of workers (I assume that the snapshots were taken when
> that server was not actively processing data).
>
> For reference: the issue that we are experiencing (possibly caused by
> this) is tracked in https://igniterealtime.atlassian.net/browse/OF-2367.
> Multiple people are reporting the issue, but I've been unable to reproduce
> it locally.
>
> Kind regards,
>
>   Guus
>
> [image: image.png]
>
>

Reply via email to