Closing the flusher instead of just disconnecting after a GO_AWAY.

This ensures that frames that may have been added to the flusher queue
concurrently after the GO_AWAY are properly failed and the queue
drained.
This commit is contained in:
Simone Bordet 2014-08-11 11:30:49 +02:00
parent 59a9c0890c
commit 187c42fa4a
2 changed files with 2 additions and 12 deletions

View File

@ -300,13 +300,6 @@ public class HTTP2Flusher extends IteratingCallback
terminate(x);
}
@Override
public void close()
{
super.close();
iterate();
}
private void terminate(Throwable x)
{
Queue<Entry> queued;

View File

@ -355,10 +355,7 @@ public abstract class HTTP2Session implements ISession, Parser.Listener
@Override
public void reset(ResetFrame frame, Callback callback)
{
if (closed.get())
callback.succeeded();
else
control(getStream(frame.getStreamId()), frame, callback);
control(getStream(frame.getStreamId()), frame, callback);
}
@Override
@ -662,7 +659,7 @@ public abstract class HTTP2Session implements ISession, Parser.Listener
}
case GO_AWAY:
{
disconnect();
flusher.close();
break;
}
default: