hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [27/50] httpcomponents-core git commit: HTTPCORE-455: fatal Error in an individual worker thread does not cause proper I/O reactor shutdown
Date Tue, 09 May 2017 20:01:53 GMT
HTTPCORE-455: fatal Error in an individual worker thread does not cause proper I/O reactor
shutdown

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpcore/branches/4.4.x@1792524
13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/efb11b8f
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/efb11b8f
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/efb11b8f

Branch: refs/heads/4.4.x
Commit: efb11b8fd0b54dab147f3c4f63eebf62ae11863c
Parents: bde8ec2
Author: Oleg Kalnichevski <olegk@apache.org>
Authored: Mon Apr 24 18:10:17 2017 +0000
Committer: Oleg Kalnichevski <olegk@apache.org>
Committed: Mon Apr 24 18:10:17 2017 +0000

----------------------------------------------------------------------
 .../http/impl/nio/reactor/AbstractMultiworkerIOReactor.java | 9 ++++++---
 .../org/apache/http/nio/reactor/IOReactorException.java     | 7 +++++++
 2 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/efb11b8f/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
index 020804d..44830b6 100644
--- a/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
+++ b/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/AbstractMultiworkerIOReactor.java
@@ -351,7 +351,7 @@ public abstract class AbstractMultiworkerIOReactor implements IOReactor
{
                 // Verify I/O dispatchers
                 for (int i = 0; i < this.workerCount; i++) {
                     final Worker worker = this.workers[i];
-                    final Exception ex = worker.getException();
+                    final Throwable ex = worker.getThrowable();
                     if (ex != null) {
                         throw new IOReactorException(
                                 "I/O dispatch worker terminated abnormally", ex);
@@ -574,7 +574,7 @@ public abstract class AbstractMultiworkerIOReactor implements IOReactor
{
         final BaseIOReactor dispatcher;
         final IOEventDispatch eventDispatch;
 
-        private volatile Exception exception;
+        private volatile Throwable exception;
 
         public Worker(final BaseIOReactor dispatcher, final IOEventDispatch eventDispatch)
{
             super();
@@ -586,12 +586,15 @@ public abstract class AbstractMultiworkerIOReactor implements IOReactor
{
         public void run() {
             try {
                 this.dispatcher.execute(this.eventDispatch);
+            } catch (final Error ex) {
+                this.exception = ex;
+                throw ex;
             } catch (final Exception ex) {
                 this.exception = ex;
             }
         }
 
-        public Exception getException() {
+        public Throwable getThrowable() {
             return this.exception;
         }
 

http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/efb11b8f/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java
----------------------------------------------------------------------
diff --git a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java
b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java
index f3cfe19..917b26a 100644
--- a/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java
+++ b/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java
@@ -46,6 +46,13 @@ public class IOReactorException extends IOException {
         }
     }
 
+    public IOReactorException(final String message, final Throwable cause) {
+        super(message);
+        if (cause != null) {
+            initCause(cause);
+        }
+    }
+
     public IOReactorException(final String message) {
         super(message);
     }


Mime
View raw message