Repository navigation
test/overload: Fix flaky Http1SafeMaxConnectionDuration - #49258
Conversation
…ctionDuration Signed-off-by: Ryan Northey <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the test-only timeout adjustment intended to reduce flakiness.
No open issues 🎉
What changed in this PR
This test-only change addresses flakiness in Http1SafeMaxConnectionDuration, particularly with HTTP/1 downstream and HTTP/3 upstream connections, while preserving overload-duration coverage.
Changes:
- Disables the delayed-close timeout so the final response can finish flushing before connection closure.
- Adds a comment explaining how simulated time can trigger closure before the response is written.
| File | Description |
|---|---|
test/integration/overload_integration_test.cc |
Disables the timeout in the affected test and documents the reason. |
Review effort: Balanced
| // Close the connection only once the final response has been written. A delayed close | ||
| // timer runs on simulated time and can fire before the response is written, so the | ||
| // client would see the connection close instead of the response. | ||
| cm.mutable_delayed_close_timeout()->set_nanos(0); |
There was a problem hiding this comment.
| cm.mutable_delayed_close_timeout()->set_nanos(0); | |
| cm.mutable_delayed_close_timeout()->CopyFrom(ProtobufUtil::TimeUtil::SecondsToDuration(0)); |
(It's more readable and accurate than only setting nanos which could potentially leave seconds>0.)
Also the line of code above uses MergeFrom for this, which does nothing, so should either be removed or replaced with CopyFrom. (MergeFrom only copies "set" values, and in proto3 values holding their default value are considered "unset", so MergeFrom({0,0}) will leave the target message unchanged.)
There was a problem hiding this comment.
Thanks, done in 8815172: both lines now use CopyFrom. The drain timeout was already 0s before this, because mutable_drain_timeout() makes the field present, so neither line changes behaviour.
(bot assisted)
Set the drain and delayed close timeouts to 0s with `CopyFrom`, which is clearer and sets both fields of the duration. `MergeFrom` of a 0s duration copies nothing (the default values are not set in proto3), so it only worked because `mutable_` had already made the field present. Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
`Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
…9258) `Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDuration` flakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan: https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414 The second request gets a reset instead of its response (`overload_integration_test.cc:701`). With trace logs, Envoy encodes the response with `connection: close` and starts closing the downstream connection with the response still buffered (`closing data_to_write=157`), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (envoyproxy#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead. Disable the delayed close timeout in this test, so that the connection closes once the response has been written. Risk Level: low (test only) Testing: Deflake, tsan, `*Http1SafeMaxConnectionDuration*`, 1000 runs: - main (cacf8e2): 74/1000 failed, all at `overload_integration_test.cc:701`, all HTTP/1 downstream with HTTP/3 upstream - this PR (33fd513): 0/1000 failed Docs Changes: n/a Release Notes: n/a --------- Signed-off-by: Ryan Northey <[email protected]> (cherry picked from commit b3812bd) Signed-off-by: Ryan Northey <[email protected]>
Commit Message: test/overload: Fix flaky Http1SafeMaxConnectionDuration
Additional Description:
Protocols/OverloadScaledTimerIntegrationTest.Http1SafeMaxConnectionDurationflakes for HTTP/1 downstream with an HTTP/3 upstream, e.g. in postsubmit tsan:https://github.com/envoyproxy/envoy/actions/runs/43524148177/job/132225692414
The second request gets a reset instead of its response (
overload_integration_test.cc:701). With trace logs, Envoy encodes the response withconnection: closeand starts closing the downstream connection with the response still buffered (closing data_to_write=157), arming the 10ms delayed close timer from the integration test defaults. That timer runs on simulated time (#49120) and can fire before the connection gets a write event, which with an HTTP/3 upstream is busy on the same worker. Envoy then closes the socket without writing the response, and the client sees the connection close instead.Disable the delayed close timeout in this test, so that the connection closes once the response has been written.
Risk Level: low (test only)
Testing:
Deflake, tsan,
*Http1SafeMaxConnectionDuration*, 1000 runs:overload_integration_test.cc:701, all HTTP/1 downstream with HTTP/3 upstreamDocs Changes: n/a
Release Notes: n/a