aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jakob Buchgraber <buchgr@google.com>2018-04-10 04:56:25 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-10 04:57:34 -0700
commit04ce86e8ba96630f89a436167b7f3a195c5e50e7 (patch)
tree9f22858c9e2f6558e103238aebd7534a09970ebc
parentf1f5f99a98e65f43aab8c5dba6ed6f6871c479cd (diff)
remote/http: properly complete user promise
Fixes #4976, #4935 Closes #4991. PiperOrigin-RevId: 192269206
-rw-r--r--src/main/java/com/google/devtools/build/lib/remote/blobstore/http/AbstractHttpHandler.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/remote/blobstore/http/AbstractHttpHandler.java b/src/main/java/com/google/devtools/build/lib/remote/blobstore/http/AbstractHttpHandler.java
index 0c4c8e2bee..c9cdd0c853 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/blobstore/http/AbstractHttpHandler.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/blobstore/http/AbstractHttpHandler.java
@@ -94,8 +94,9 @@ abstract class AbstractHttpHandler<T extends HttpObject> extends SimpleChannelIn
}
@Override
- public void exceptionCaught(ChannelHandlerContext channelHandlerContext, Throwable throwable) {
- failAndResetUserPromise(throwable);
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable t) {
+ failAndResetUserPromise(t);
+ ctx.fireExceptionCaught(t);
}
@SuppressWarnings("FutureReturnValueIgnored")
@@ -131,6 +132,7 @@ abstract class AbstractHttpHandler<T extends HttpObject> extends SimpleChannelIn
@SuppressWarnings("FutureReturnValueIgnored")
@Override
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) {
+ failAndResetUserPromise(new ClosedChannelException());
ctx.deregister(promise);
}
@@ -147,8 +149,19 @@ abstract class AbstractHttpHandler<T extends HttpObject> extends SimpleChannelIn
}
@Override
- public void channelInactive(ChannelHandlerContext channelHandlerContext) throws Exception {
+ public void channelInactive(ChannelHandlerContext ctx) {
+ failAndResetUserPromise(new ClosedChannelException());
+ ctx.fireChannelInactive();
+ }
+
+ @Override
+ public void handlerRemoved(ChannelHandlerContext ctx) {
+ failAndResetUserPromise(new IOException("handler removed"));
+ }
+
+ @Override
+ public void channelUnregistered(ChannelHandlerContext ctx) {
failAndResetUserPromise(new ClosedChannelException());
- super.channelInactive(channelHandlerContext);
+ ctx.fireChannelUnregistered();
}
}