Repository navigation
proxy: carried patch — HTTP/3 pools keep the persistent QUIC info alive after a CDS removal (#1074) - #1077
Merged
Conversation
…ve after a CDS removal (#1074) Carries envoy-aether1074-quic-persistent-info-lifetime.patch on the 726d7ac pin, after aether1054c. The per-cluster persistent QUIC info (connection helper and clock, alarm factory, QUIC config) was owned by the thread-local cluster entry while HTTP/3 pools referenced it and their connections held raw pointers into it. A CDS removal destroys the entry after only draining its pools, so a pool with live streams outlived the info and the next write or alarm read the freed clock: the w01 SIGBUS in QuicConnection::CanWrite. The info is now shared and each HTTP/3 pool and connectivity grid holds a reference. An upstream bug. Its test (http3 conn_pool_test) needs quiche's test tooling and runs in the Envoy workspace only; carried_patch_tests passes and //:envoy builds with the patch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WyMzptZ12rAgMW8cXtKqE4 Signed-off-by: Bruno Palermo <[email protected]>
Owner
Author
Kind red/green (real CDS removal of a live h3 twin, no code revert)Two kind nodes; a loader pod (SA
4/23 ≈ 17% per removal, so 0/34 by chance ≈ 0.2%. With the patch, in-flight h3 streams on the removed twin completed with 200 (no 5xx); the only client errors were connect failures while the Service itself was deleted (the trigger, not the drain). |
bpalermo
added a commit
that referenced
this pull request
Sep 30, 2026
…ied patches, config tables, CLAUDE.md package map (#1081) * docs: refresh after the QUIC/hot-restart work — rollback advice, carried patches, config tables, CLAUDE.md package map - runbook: the 1.0.11 escape hatch rolls the proxy (a1bcf05 vs 71be75f) and drops the #1074 patch unless proxy.image + proxy.supervisor.image are pinned; #979 is merged (soak-verdict placeholder); #1069 named as the #1054 root cause; new #1074 SIGBUS entry (#1077, envoyproxy/envoy#47893, chart 1.0.13); stray "0 disables the prune" moved. - configuration: proxy drainStrategy/skipParentStats/terminationGrace, agent eastWestQuicIdleTimeout + flag, controller identity-gate flags, identity-ready section, cni-install --otlp-pin-endpoint, edge/registrar rows (the shared edge Service has no `type`; overload is fixed_heap). - CLAUDE.md/AGENTS.md: TPROXY capture, QUIC/xDS/supervisor/CNI packages, port map, carried patches; proxy-ready ships in the supervisor image. - README, getting-started, e2e, proposals 037/038/040 status lines. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr * docs: record the 2026-09-30 re-soak verdict for the unconditional-QUIC build (#979) Every QUIC gate passed and #1073/#1074 did not recur; the run failed only on liveness (9 / 719,984) from a hot-restart/agent-restart overlap (#1085). First-use 503 NC burst and TRIPLE 504 UT filed as #1086 and #1087. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries
proxy/bazel/patches/envoy-aether1074-quic-persistent-info-lifetime.patchon the 726d7ac pin, after aether1054c, for the w01 SIGBUS in #1074. An upstream Envoy bug (present on main); to be proposed upstream separately.Mechanism
Crash:
Caught Bus error, suspect faulting address 0x6f72702f747365(ASCII "est/pro": a pointer loaded from freed memory reused by a string) inquic::QuicConnection::OnCanWrite←EnvoyQuicClientConnection::onFileEvent, 57 ms after CDS removed 10quic:twin clusters that still carried 70+ rps. Symbolized against the unstripped a1bcf05 binary, the fault is inQuicConnection::CanWrite()called atOnCanWrite+0x150, afterwriter_->IsWriteBlocked()at the top ofOnCanWritesucceeded: the connection and its writer were alive.CanWritethen readsclock_->Now(), and the clock is not owned by the connection.It lives in
Quic::PersistentQuicInfoImpl(connection helper with itsEnvoyQuicClock, alarm factory, QUIC config, crypto stream factory, writer factory), which was aunique_ptrmember of the thread-localClusterEntry(cluster_manager_impl.h,quic_info_).Http3ConnPoolImplheld it by reference, and every upstream QUIC connection keeps raw pointers into it (QuicConnection::clock_, each alarm's clock). On a CDS removal the worker erases the thread-local cluster,~ClusterEntryrunsdrainConnPools()(DrainAndDelete: busy clients with live streams keep running) and then destroys its members, including the info. The pools live on inhost_http_conn_pool_map_with connections pointing into freed memory, and the next write-ready event or alarm dereferences the clock. It needs streams in flight at the removal, hence intermittent: the earlier prune found the twins idle, so their connections closed at drain start and nothing outlived the entry. Upstream since envoyproxy/envoy#19862 (2022), which moved the info into the cluster entry to share 0-RTT keys across pools.#1073/#1076 stop aether from pruning live twins, which removes the trigger seen here; any other CDS removal of an HTTP/3 cluster under load (demand-set shrink, a destination leaving the dependency set) can still hit it until this lands.
The change
Http::PersistentQuicInfogainsenable_shared_from_thisand akeepAlive()helper, andPersistentQuicInfoPtrbecomes ashared_ptr. The cluster keeps creating and holding the info as before;Http3ConnPoolImplandConnectivityGrideach take a keep-alive reference at construction, so the info lives until the last pool using it is destroyed. A pool destroys its connections first (destructAllConnections()in its destructor), so their raw pointers never outlive it. No function signatures change;keepAlive()returns null for an info owned some other way (tests), which keeps the old behavior there. No change on a healthy path.Test (red without, green with)
test/common/http/http3/conn_pool_test.ccPoolKeepsPersistentQuicInfoAliveAfterItsCreatorReleasesIt: create the info the way the cluster manager does, build a pool on it, release the creator's reference (the cluster going away): the info must still be alive; destroy the pool: the info must be gone. Without the pool change it is freed at release (info.expired()true). Also passing in the Envoy workspace: the rest of the HTTP/3 pool tests,conn_pool_grid_test,cluster_manager_impl_test,client_connection_factory_impl_test,quic_http_integration_test,multiplexed_integration_test, format and spelling.The test cannot build inside
proxy/(quiche's test tooling is not wired into the downstream module, like the other QUIC tests), so it is noted in the suite file rather than listed;//bazel/patches:carried_patch_testspasses 8/8 with the patch applied and//:envoybuilds.What the soak should show
No change in normal operation. The crash signature (SIGBUS/SEGV in
QuicConnection::OnCanWrite/CanWriteor an alarm shortly after a CDS removal ofquic:clusters) should no longer occur even if a live HTTP/3 cluster is removed under load. A direct check: temporarily let the agent prune a twin with live streams (the pre-#1076 behavior) on kind under h3 load; before this patch that is the #1074 crash, after it the removed cluster's connections drain and close normally.🤖 Generated with Claude Code
https://claude.ai/code/session_01WyMzptZ12rAgMW8cXtKqE4