WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Server sends GOAWAY frame with ProtocoleError as error and message: First received frame was not SETTINGS. #8

@huycn

Description

@huycn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions