hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1066495 - /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
Date Wed, 02 Feb 2011 15:07:54 GMT
Author: olegk
Date: Wed Feb  2 15:07:54 2011
New Revision: 1066495

URL: http://svn.apache.org/viewvc?rev=1066495&view=rev
Log:
Propagate exceptions from worker threads even if the I/O reactor is being shut down

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java?rev=1066495&r1=1066494&r2=1066495&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
Wed Feb  2 15:07:54 2011
@@ -309,23 +309,23 @@ public abstract class AbstractMultiworke
                     throw new IOReactorException("Unexpected selector failure", ex);
                 }
 
-                if (this.status.compareTo(IOReactorStatus.ACTIVE) > 0) {
-                    break;
+                if (this.status.compareTo(IOReactorStatus.ACTIVE) == 0) {
+                    processEvents(readyCount);
                 }
-                processEvents(readyCount);
 
                 // Verify I/O dispatchers
                 for (int i = 0; i < this.workerCount; i++) {
                     Worker worker = this.workers[i];
-                    Thread thread = this.threads[i];
-                    if (!thread.isAlive()) {
-                        Exception ex = worker.getException();
-                        if (ex != null) {
-                            throw new IOReactorException(
-                                    "I/O dispatch worker terminated abnormally", ex);
-                        }
+                    Exception ex = worker.getException();
+                    if (ex != null) {
+                        throw new IOReactorException(
+                                "I/O dispatch worker terminated abnormally", ex);
                     }
                 }
+
+                if (this.status.compareTo(IOReactorStatus.ACTIVE) > 0) {
+                    break;
+                }
             }
 
         } catch (ClosedSelectorException ex) {



Mime
View raw message