You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by hi...@apache.org on 2005/10/25 10:50:33 UTC

svn commit: r328316 - /james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java

Author: hilmer
Date: Tue Oct 25 01:50:29 2005
New Revision: 328316

URL: http://svn.apache.org/viewcvs?rev=328316&view=rev
Log:
JAMES-428

Modified:
    james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java

Modified: james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java?rev=328316&r1=328315&r2=328316&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java (original)
+++ james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java Tue Oct 25 01:50:29 2005
@@ -220,6 +220,18 @@
      * @param clientConnectionRunner the ClientConnectionRunner to be removed
      */
     private void removeClientConnectionRunner(ClientConnectionRunner clientConnectionRunner) {
+
+       /*
+        * checking runnerPool avoids 'dead-lock' when service is disposing :
+        * (dispose() calls dispose all runners)
+        * but runner is 'running' and cleans up on exit
+        * this situation will result in a dead-lock on 'clientConnectionRunners'
+        */
+        if( runnerPool == null ) {
+            getLogger().info("ServerConnection.removeClientConnectionRunner - dispose has been called - so just return : " + clientConnectionRunner );
+            return;
+        }
+        
         synchronized (clientConnectionRunners) {
             if (clientConnectionRunners.remove(clientConnectionRunner)) {
                 if (getLogger().isDebugEnabled()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org