[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mina-commits
Subject:    [mina] branch 2.1.X updated: Move the idleWorkers.incrementAndGet(); out of the finally section, it 
From:       elecharny () apache ! org
Date:       2022-01-12 13:48:14
Message-ID: 164199529449.6100.16490782352232205940 () gitbox ! apache ! org
[Download RAW message or body]

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 <elecharny@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) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic