tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r950341 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/tomcat/util/net/AprEndpoint.java java/org/apache/tomcat/util/net/JIoEndpoint.java java/org/apache/tomcat/util/net/NioEndpoint.java webapps/docs/changelog.xml
Date Wed, 02 Jun 2010 02:39:54 GMT
Author: kkolinko
Date: Wed Jun  2 02:39:54 2010
New Revision: 950341

URL: http://svn.apache.org/viewvc?rev=950341&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48843
Prevent possible deadlock for worker allocation in NIO/BIO/APR connectors,
caused by missing Object.notify() wakeup.

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=950341&r1=950340&r2=950341&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jun  2 02:39:54 2010
@@ -50,12 +50,6 @@ PATCHES PROPOSED TO BACKPORT:
       markt: It shouldn't break existing configs. JSSE allows trust stores to be
              read without providing the password
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=48843
-  Port deadlock prevention for worker allocation from NIO to BIO and APR
-  https://issues.apache.org/bugzilla/attachment.cgi?id=25225
-  +1: kkolinko, markt, rjung
-  -1:
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49030
   Failure of one connector should not leave some connectors started and some
   ignored

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=950341&r1=950340&r2=950341&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed Jun  2 02:39:54
2010
@@ -1017,18 +1017,17 @@ public class AprEndpoint {
      */
     protected Worker getWorkerThread() {
         // Allocate a new worker thread
-        Worker workerThread = createWorkerThread();
-        while (workerThread == null) {
-            try {
-                synchronized (workers) {
+        synchronized (workers) {
+            Worker workerThread;
+            while ((workerThread = createWorkerThread()) == null) {
+                try {
                     workers.wait();
+                } catch (InterruptedException e) {
+                    // Ignore
                 }
-            } catch (InterruptedException e) {
-                // Ignore
             }
-            workerThread = createWorkerThread();
+            return workerThread;
         }
-        return workerThread;
     }
 
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=950341&r1=950340&r2=950341&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Wed Jun  2 02:39:54
2010
@@ -752,18 +752,17 @@ public class JIoEndpoint {
      */
     protected Worker getWorkerThread() {
         // Allocate a new worker thread
-        Worker workerThread = createWorkerThread();
-        while (workerThread == null) {
-            try {
-                synchronized (workers) {
+        synchronized (workers) {
+            Worker workerThread;
+            while ((workerThread = createWorkerThread()) == null) {
+                try {
                     workers.wait();
+                } catch (InterruptedException e) {
+                    // Ignore
                 }
-            } catch (InterruptedException e) {
-                // Ignore
             }
-            workerThread = createWorkerThread();
+            return workerThread;
         }
-        return workerThread;
     }
 
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=950341&r1=950340&r2=950341&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Jun  2 02:39:54
2010
@@ -1218,19 +1218,17 @@ public class NioEndpoint {
      */
     protected Worker getWorkerThread() {
         // Allocate a new worker thread
-        Worker workerThread = createWorkerThread();
-        while (workerThread == null) {
-            try {
-                synchronized (workers) {
-                    workerThread = createWorkerThread();
-                    if ( workerThread == null ) workers.wait();
+        synchronized (workers) {
+            Worker workerThread;
+            while ((workerThread = createWorkerThread()) == null) {
+                try {
+                    workers.wait();
+                } catch (InterruptedException e) {
+                    // Ignore
                 }
-            } catch (InterruptedException e) {
-                // Ignore
             }
-            if ( workerThread == null ) workerThread = createWorkerThread();
+            return workerThread;
         }
-        return workerThread;
     }
 
 

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=950341&r1=950340&r2=950341&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Wed Jun  2 02:39:54 2010
@@ -150,6 +150,10 @@
         <bug>48839</bug>: Correctly handle HTTP header folding in the NIO
         connector. Patch suggested by Richa Baronia. (markt)
       </fix>
+      <fix>
+        <bug>48843</bug>: Prevent possible deadlock for worker allocation in
+        connectors. (kkolinko)
+      </fix>
       <add>
         <bug>48862</bug>: Add support for the backlog parameter to the AJP
         connector. (pero/markt)



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


Mime
View raw message