-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
connection: Do not reset delayed closed timer if doWrite consumes 0 bytes from the output buffer. #11833
connection: Do not reset delayed closed timer if doWrite consumes 0 bytes from the output buffer. #11833
Conversation
…ytes from the output buffer. Signed-off-by: Antonio Vicente <avd@google.com>
/cc @davinci26 Hey Sotiris, Can you double check that this change addresses your problem? |
delayed_close_timer_->enableTimer(delayed_close_timeout_); | ||
ASSERT(delayed_close_timer_ != nullptr && delayed_close_timer_->enabled()); | ||
if (result.bytes_processed_ > 0) { | ||
delayed_close_timer_->enableTimer(delayed_close_timeout_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a way to distinguish between these two enableTimer calls in tests. Ideally we would move delayed_close_state_ to a WaitingForClose state or change the fd mask to:
file_event_->setEnabled(enable_half_close_ ? 0 : Event::FileReadyType::Closed);
to avoid getting any Write events past this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah, but I'll trust you made sure your test would fail without the code change :-)
/assign @davinci26 |
@davinci26 cannot be assigned to this issue. |
LGTM it address the issue. I have verified it locally in my devbox |
…_only_if_made_progress Signed-off-by: Antonio Vicente <avd@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though I'd bump the risk to medium because event loop changes. I'll merge after we cut the release :-)
delayed_close_timer_->enableTimer(delayed_close_timeout_); | ||
ASSERT(delayed_close_timer_ != nullptr && delayed_close_timer_->enabled()); | ||
if (result.bytes_processed_ > 0) { | ||
delayed_close_timer_->enableTimer(delayed_close_timeout_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah, but I'll trust you made sure your test would fail without the code change :-)
Bumped up to medium. Thanks! |
* Revert "test: shard http2_integration_test (envoyproxy#11939)" This reverts commit 2026ec2. * Revert "fuzz: added fuzz test for listener filter original_dst (envoyproxy#11847)" This reverts commit 673cab8. * Revert "docs: updating release instructions (envoyproxy#11938)" This reverts commit 09b96a5. * Revert "test: remove superfluous test dependencies (envoyproxy#11912)" This reverts commit 5e9fb8a. * Revert "dynamic_forward_proxy: cleanup integration test (envoyproxy#11891)" This reverts commit 11a4667. * Revert "preliminary PR to Porting Envoy to C++17 (envoyproxy#11840)" This reverts commit 9ad964d. * Revert "connection: Do not reset delayed closed timer if doWrite consumes 0 bytes from the output buffer. (envoyproxy#11833)" This reverts commit 5960533. * Revert "threadlocal: avoiding a dynamic cast in opt builds (envoyproxy#11900)" This reverts commit 363b104. * Revert "release: kicking off 1.16.0 (envoyproxy#11930)" This reverts commit ef74d8f. Signed-off-by: Lizan Zhou <lizan@tetrate.io>
…ytes from the output buffer. (envoyproxy#11833) Commit Message: connection: Do not reset delayed closed timer if doWrite consumes 0 bytes from the output buffer. Additional Description: Only reset the delayed close timer if the write attempt made progress. This works around spurious fd Write events which are delivered to a connection even after it manages to fully drain the output buffer and should be waiting for client FIN or the delay close timer to expire. This is known to happen when listening for level events instead of edge-trigger fd events. Risk Level: medium, changes to timeout behavior. Testing: unit Docs Changes: n/a Release Notes: n/a Fixes envoyproxy#11829 Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: scheler <santosh.cheler@appdynamics.com>
Commit Message: connection: Do not reset delayed closed timer if doWrite consumes 0 bytes from the output buffer.
Additional Description: Only reset the delayed close timer if the write attempt made progress. This works around spurious fd Write events which are delivered to a connection even after it manages to fully drain the output buffer and should be waiting for client FIN or the delay close timer to expire. This is known to happen when listening for level events instead of edge-trigger fd events.
Risk Level: medium, changes to timeout behavior.
Testing: unit
Docs Changes: n/a
Release Notes: n/a
Fixes #11829