http-clint-branch: review comment - route errors and cf completion fix in SubscriberWrapper
--- a/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java Wed Jun 20 15:56:17 2018 +0100
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/common/SubscriberWrapper.java Wed Jun 20 16:51:10 2018 +0100
@@ -260,6 +260,8 @@
try {
run1();
} catch (Throwable t) {
+ if (debug.on())
+ debug.log("DownstreamPusher threw: " + t);
errorCommon(t);
}
}
@@ -292,6 +294,7 @@
pushScheduler.stop();
outputQ.clear();
downstreamSubscriber.onError(error);
+ cf.completeExceptionally(error);
return;
}
@@ -383,9 +386,8 @@
(throwable = new AssertionError("null throwable")) != null;
if (errorRef.compareAndSet(null, throwable)) {
if (debug.on()) debug.log("error", throwable);
+ upstreamCompleted = true;
pushScheduler.runOrSchedule();
- upstreamCompleted = true;
- cf.completeExceptionally(throwable);
return true;
}
return false;