Bug fix: main async request execution handlers to release teh associated response consumer upon exception

This commit is contained in:
Oleg Kalnichevski 2019-03-07 08:41:44 +01:00
parent 74ae768e0d
commit 39023dfed1
2 changed files with 8 additions and 0 deletions

View File

@ -100,6 +100,10 @@ public class Http2AsyncMainClientExec implements AsyncExecChainHandler {
@Override
public void failed(final Exception cause) {
final AsyncDataConsumer entityConsumer = entityConsumerRef.getAndSet(null);
if (entityConsumer != null) {
entityConsumer.releaseResources();
}
execRuntime.markConnectionNonReusable();
asyncExecCallback.failed(cause);
}

View File

@ -116,6 +116,10 @@ class HttpAsyncMainClientExec implements AsyncExecChainHandler {
@Override
public void failed(final Exception cause) {
final AsyncDataConsumer entityConsumer = entityConsumerRef.getAndSet(null);
if (entityConsumer != null) {
entityConsumer.releaseResources();
}
execRuntime.markConnectionNonReusable();
asyncExecCallback.failed(cause);
}