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

quic: fix connection close error when blocked socket gets unblocked #36238

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

danzh2010
Copy link
Contributor

@danzh2010 danzh2010 commented Sep 19, 2024

Commit Message: today the connection will be closed with QUIC_INTERNAL_ERROR because of https://github.com/google/quiche/blob/4249f8025caed1e3d71d04d9cadf42251acb7cac/quiche/quic/core/quic_connection.cc#L2703 if the socket becomes write blocked and then unblocked. This change fixes it by calling OnBlockedWriterCanWrite() instead which set the writer to be unblocked before OnCanWrite().

Additional Message: also refined some comments in the same file.

Risk Level: low, fix existing issue
Testing: added unit tests
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Dan Zhang <[email protected]>
@danzh2010
Copy link
Contributor Author

/retest

@danzh2010
Copy link
Contributor Author

/assign @abeyad

@danzh2010
Copy link
Contributor Author

/retest

@@ -242,7 +242,7 @@ void EnvoyQuicClientConnection::onFileEvent(uint32_t events,
ASSERT(events & (Event::FileReadyType::Read | Event::FileReadyType::Write));

if (events & Event::FileReadyType::Write) {
OnCanWrite();
OnBlockedWriterCanWrite();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this call still work if the writer is not blocked?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nevermind, I see that it unblocks the writer before calling OnCanWrite()

Copy link
Contributor Author

@danzh2010 danzh2010 Sep 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and writer_->SetWritable() is a no-op on unblocked writer:

void setWritable() override { write_blocked_ = false; }

@abeyad
Copy link
Contributor

abeyad commented Sep 20, 2024

/assign @RyanTheOptimist

@zuercher zuercher merged commit cfb1b7e into envoyproxy:main Sep 20, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants