Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/1.x client connection pause/resume race #3849

Closed
vietj opened this issue Mar 11, 2021 · 0 comments
Closed

HTTP/1.x client connection pause/resume race #3849

vietj opened this issue Mar 11, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@vietj
Copy link
Member

vietj commented Mar 11, 2021

The Http1xClientConnection is resumed and paused by the connection and individual streams. When those streams are dispatched on a different context than the connection context, there can be races due to miss notifications and the channel auto-read status remains paused preventing other HTTP streams to be received.

@vietj vietj added the bug label Mar 11, 2021
@vietj vietj changed the title HTTP/1.x client connection plausibility race HTTP/1.x client connection pause/resume race Mar 11, 2021
@vietj vietj self-assigned this Mar 11, 2021
@vietj vietj added this to the 4.0.3 milestone Mar 11, 2021
vietj added a commit that referenced this issue Mar 11, 2021
…d individual streams. When those streams are dispatched on a different context than the connection context, there can be races due to miss notifications and the channel auto-read status remains paused preventing other HTTP streams to be received.

Instead of relying on each stream to cooperate for setting the channel auto-read status we define now a channel a window of bytes whose value determines the channel auto-read status. Each received buffer fills the bytes window, each buffer read by the response updates the window accordingly. We use the channel low/high watermarks configuration to update the channel auto-read status.

When the channel and its streams use the same event-loop this is an immediate operation, otherwise the stream sends a message to update the bytes window. The channel gets exclusive access to the bytes window value and the channel auto-read status and be race free.

fixes #3849

Signed-off-by: Julien Viet <julien@julienviet.com>
vietj added a commit that referenced this issue Mar 11, 2021
…d individual streams. When those streams are dispatched on a different context than the connection context, there can be races due to miss notifications and the channel auto-read status remains paused preventing other HTTP streams to be received.

Instead of relying on each stream to cooperate for setting the channel auto-read status we define now a channel a window of bytes whose value determines the channel auto-read status. Each received buffer fills the bytes window, each buffer read by the response updates the window accordingly. We use the channel low/high watermarks configuration to update the channel auto-read status.

When the channel and its streams use the same event-loop this is an immediate operation, otherwise the stream sends a message to update the bytes window. The channel gets exclusive access to the bytes window value and the channel auto-read status and be race free.

fixes #3849

Signed-off-by: Julien Viet <julien@julienviet.com>
@vietj vietj closed this as completed in 0561acb Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant