This is an automated email from the ASF dual-hosted git repository.

elecharny pushed a commit to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git


The following commit(s) were added to refs/heads/2.1.X by this push:
     new 5db4447  Move the idleWorkers.incrementAndGet(); out of the finally 
section, it will cause inconsistant count of idle sessions.
5db4447 is described below

commit 5db4447ce78897cd9c71d68f531d9f6be12af37e
Author: emmanuel lecharny <elecha...@apache.org>
AuthorDate: Wed Jan 12 14:47:53 2022 +0100

    Move the idleWorkers.incrementAndGet(); out of the finally section, it
    will cause inconsistant count of idle sessions.
---
 .../apache/mina/filter/executor/OrderedThreadPoolExecutor.java | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/mina-core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java
 
b/mina-core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java
index 6089d3e..c800864 100644
--- 
a/mina-core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java
+++ 
b/mina-core/src/main/java/org/apache/mina/filter/executor/OrderedThreadPoolExecutor.java
@@ -693,13 +693,11 @@ public class OrderedThreadPoolExecutor extends 
ThreadPoolExecutor {
                         break;
                     }
 
-                    try {
-                        if (session != null) {
-                            runTasks(getSessionTasksQueue(session));
-                        }
-                    } finally {
-                        idleWorkers.incrementAndGet();
+                    if (session != null) {
+                        runTasks(getSessionTasksQueue(session));
                     }
+
+                    idleWorkers.incrementAndGet();
                 }
             } finally {
                 synchronized (workers) {

Reply via email to