What happens is that when we let the HTTP2Client idle for while (few min) and then post a new request, we receives immediately a SETTINGS frame for which the client replies with another SETTINGS frame with Ack=True before sending another SETTINGS (Ack=false) frame which is part of new request. In such case the server will terminate the connection with a GOAWAY frame as follow:
<- [Frame: SETTINGS, Id=0, Ack=False, ...]-> [Frame: SETTINGS, Id=0, Ack=True, ...]-> [Frame: SETTINGS, Id=0, Ack=False, ...]-> [Frame: HEADERS, Id=15, ...]-> [Frame: DATA, Id=15, ...]<- [Frame: GOAWAY, Id=0, ErrorCode=1, LastStreamId=0, AdditionalDebugData=First received frame was not SETTINGS. Hex dump for first 5 bytes: 0000000401]
For now, to workaround this issue, I insert an await Task.Delay(50) before queuing acknowledge frame, that is in Http2Connection.read() line 129,
if (!settingsFrame.Ack) {await Task.Delay(50); // this is inserted lineawait QueueFrame(new SettingsFrame { Ack = true }).ConfigureAwait(false);}
and the issue above will not happen.
However, I see this modif is more a hack than a fix. I wonder if someone could fix this problem at its root.
What happens is that when we let the HTTP2Client idle for while (few min) and then post a new request, we receives immediately a SETTINGS frame for which the client replies with another SETTINGS frame with Ack=True before sending another SETTINGS (Ack=false) frame which is part of new request. In such case the server will terminate the connection with a GOAWAY frame as follow:
<- [Frame: SETTINGS, Id=0, Ack=False, ...]
-> [Frame: SETTINGS, Id=0, Ack=True, ...]
-> [Frame: SETTINGS, Id=0, Ack=False, ...]
-> [Frame: HEADERS, Id=15, ...]
-> [Frame: DATA, Id=15, ...]
<- [Frame: GOAWAY, Id=0, ErrorCode=1, LastStreamId=0, AdditionalDebugData=First received frame was not SETTINGS. Hex dump for first 5 bytes: 0000000401]
For now, to workaround this issue, I insert an
await Task.Delay(50)
before queuing acknowledge frame, that is in Http2Connection.read() line 129,if (!settingsFrame.Ack) {
await Task.Delay(50); // this is inserted line
await QueueFrame(new SettingsFrame { Ack = true }).ConfigureAwait(false);
}
and the issue above will not happen.However, I see this modif is more a hack than a fix. I wonder if someone could fix this problem at its root.
Thanks.