484167 - GOAWAY frames aren't handling disconnects appropriately on Client.

Improved handling of the failure case.
This commit is contained in:
Simone Bordet 2015-12-11 12:34:48 +01:00
parent c3889873f6
commit 77e0df1193
2 changed files with 8 additions and 3 deletions

View File

@ -168,7 +168,7 @@ public class HttpClientTransportOverHTTP2 extends ContainerLifeCycle implements
@Override
public void onFailure(Session session, Throwable failure)
{
connection.abort(failure);
connection.close(failure);
}
}
}

View File

@ -61,15 +61,20 @@ public class HttpConnectionOverHTTP2 extends HttpConnection
@Override
public void close()
{
close(new AsynchronousCloseException());
}
protected void close(Throwable failure)
{
// First close then abort, to be sure that the connection cannot be reused
// from an onFailure() handler or by blocking code waiting for completion.
getHttpDestination().close(this);
session.close(ErrorCode.NO_ERROR.code, null, Callback.NOOP);
abort(new AsynchronousCloseException());
abort(failure);
}
protected void abort(Throwable failure)
private void abort(Throwable failure)
{
for (HttpChannel channel : channels)
{