Repository navigation
QUIC eBPF hot restart part 0 - #45504
Conversation
|
Hi @filipcacky, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
Signed-off-by: Filip Cacky <[email protected]>
Signed-off-by: Filip Cacky <[email protected]>
…WorkerInit` Signed-off-by: Filip Cacky <[email protected]>
Signed-off-by: Filip Cacky <[email protected]>
Signed-off-by: Filip Cacky <[email protected]>
…ListenSocketOptions` Signed-off-by: Filip Cacky <[email protected]>
8aaf7f7 to
005b8c8
Compare
…buildListenSocketOptions` Signed-off-by: Filip Cacky <[email protected]>
005b8c8 to
5a082d4
Compare
|
First set of patches for #34731. Hot-restart, listener reload and ebpf are WIP. I would appreciate a review for this, since other changes build on top. /assign @ravenblackx @danzh2010 |
|
filipcacky is not allowed to assign users. |
…ner factory Signed-off-by: Filip Cacky <[email protected]>
Signed-off-by: Filip Cacky <[email protected]>
| } | ||
| } | ||
|
|
||
| absl::Status ActiveQuicListenerFactory::doFinalPreWorkerInit() { |
There was a problem hiding this comment.
Why moving the logic to doFinalPreWorkerInit() would require splitting context out of cid generator factory interface?
There was a problem hiding this comment.
quic_lb needs to run its init in the factory ctor, since by the time doFinalPreWorkerInit is called, init manager is already in Initialized state and calling secretsProvider results in
envoy/source/common/init/manager_impl.cc
Line 36 in f5f8d83
eBPF needs context per reuseport group and access to duplicated sockets to make it. Socket sharing hot-restart RPC runs in ListenSocketFactoryImpl after ActiveQuicListenerFactory.
ActiveQuicListenerFactory is also shared between address and additional_addresses, these need separate contexts for eBPF, for deterministic and quic_lb it doesn't matter.
Signed-off-by: Filip Cacky <[email protected]>
… after `buildListenSocketOptions`" This reverts commit 5a082d4. Signed-off-by: Filip Cacky <[email protected]>
…r `buildListenSocketOptions`" This reverts commit ae9cf11. Signed-off-by: Filip Cacky <[email protected]>
|
/retest |
Signed-off-by: Filip Cacky <[email protected]>
|
/retest |
There was a problem hiding this comment.
We still need this early return here right?
There was a problem hiding this comment.
Yes, same usecase as my in_place_update in initializeWorkerRoutingForUdpListener.
| udp_listener_config_->writer_factory_ = factory_factory->createUdpPacketWriterFactory( | ||
| config.udp_listener_config().udp_packet_packet_writer_config(), *listener_factory_context_); | ||
| } | ||
| absl::StatusOr<Network::ActiveUdpListenerFactoryPtr> udp_listener_factory = |
There was a problem hiding this comment.
Re https://github.com/envoyproxy/envoy/pull/45504/changes/BASE..00e0e562b49647aa24f6ac61ad916e0676b83c4a#r4008203051, it looks like the change would cause a subtle behavioral diff. Why not inlining createUdpListenerFactory() so we can be sure this is purely refactoring?
|
/retest |
Signed-off-by: Filip Cacky <[email protected]>
|
looks like sync with upstream main is needed /wait |
Signed-off-by: Filip Cacky <[email protected]>
| enable_session_idle_list); | ||
| } | ||
|
|
||
| absl::Status ActiveQuicListenerFactory::initializeCidGeneratorAndWorkerRouting() { |
There was a problem hiding this comment.
nits: move this above initializeWorkerRouting() for better diff
…ting Signed-off-by: Filip Cacky <[email protected]>
6e9740d to
6d20124
Compare
|
/retest |
|
Hi @RyanTheOptimist, would you like to do another pass? |
… a QUIC listener #1733's proxy workflow (run 41308410926, both arches) failed //agent/test/envoy_validate:envoy_validate_test: `envoy --mode validate` of node_bootstrap.json, edge_bootstrap.json and the ADS reconnect test's bootstrap died with SIGSEGV in Quic::ActiveQuicListenerFactory::initializeWorkerRouting(). envoyproxy/envoy#45504, in the 011e396 snapshot, moved the QUIC listener's socket options there (behind envoy.restart_features.defer_worker_routing_init, default true) and applies them to every worker's listen socket. Validation mode creates no sockets (ValidationListenerComponentFactory::createListenSocket returns nullptr), so *socket dereferences null. Upstream main still has it. The proxy-supervisor's check before every hot restart on a changed bootstrap is `envoy --mode validate`, so this would have blocked every bootstrap change in production. The patch skips a null socket, which only validation mode produces, as validation did before #45504. Regression test: envoy_validate_test in the proxy workflow, red on 8ce601a. Not reported upstream (on hold). The "FilterStateMatcherValidationError.Key: value length must be at least 1 characters" line in the same log is TestAgentCaptureListenerAndTableValidate's expected rejection ("refused as it must be"); that test passed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YacWmjoxWSZRJC38XYxuZx
… a QUIC listener #1733's proxy workflow (run 41308410926, both arches) failed //agent/test/envoy_validate:envoy_validate_test: `envoy --mode validate` of node_bootstrap.json, edge_bootstrap.json and the ADS reconnect test's bootstrap died with SIGSEGV in Quic::ActiveQuicListenerFactory::initializeWorkerRouting(). envoyproxy/envoy#45504, in the 011e396 snapshot, moved the QUIC listener's socket options there (behind envoy.restart_features.defer_worker_routing_init, default true) and applies them to every worker's listen socket. Validation mode creates no sockets (ValidationListenerComponentFactory::createListenSocket returns nullptr), so *socket dereferences null. Upstream main still has it. The proxy-supervisor's check before every hot restart on a changed bootstrap is `envoy --mode validate`, so this would have blocked every bootstrap change in production. The patch skips a null socket, which only validation mode produces, as validation did before #45504. Regression test: envoy_validate_test in the proxy workflow, red on 8ce601a. Not reported upstream (on hold). The "FilterStateMatcherValidationError.Key: value length must be at least 1 characters" line in the same log is TestAgentCaptureListenerAndTableValidate's expected rejection ("refused as it must be"); that test passed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YacWmjoxWSZRJC38XYxuZx
…er1054c and aether1074 (proposal 045) (#1733) * proxy: Envoy 1.41.0-dev.20261028.011e396 under Bazel 9.3.1; drop aether1054c and aether1074 (proposal 045) - envoy/envoy_api 1.40.0.envoy -> 1.41.0-dev.20261028.011e396.envoy, registry a1264b53 -> 36d481b01b (the commit that added the snapshot). - Dropped patches: aether1054c (envoyproxy/envoy#47868, 2eff6e8ccf) and aether1074 (envoyproxy/envoy#47893, 77b512527c), both in the snapshot. - aether1050 refreshed from envoyproxy/envoy#47834's head against its merge base, which already contains #47068: the +/- lines are unchanged, only the test file's context moved. aether1054 refreshed by hand: two one-line insertions whose neighbouring runtime guards were removed upstream. 47740 and aether1126 apply unchanged. - .bazelversion 8.7.0 -> 9.3.1 (Envoy's own; the 1.40.0 closure does not load under Bazel 9, so the move cannot land first). .bazelrc follows upstream: merge_fixed_and_default_shell_env removed, system_include_paths and the rules_rust linker_messages flags added, the toolchains_llvm compiler-rt and libunwind overrides dropped (the envoy module links compiler-rt + libunwind since envoyproxy/envoy#48641). - proxy-wasm-cpp-host .envoy -> .envoy.1, rules_cc 0.2.25 -> 0.2.27, rules_python 2.3.3 -> 2.4.5: what the new closure selects. - The MODULE.bazel comment that still called #47893 open is rewritten. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YacWmjoxWSZRJC38XYxuZx * proxy: carry aether1733, envoy --mode validate no longer segfaults on a QUIC listener #1733's proxy workflow (run 41308410926, both arches) failed //agent/test/envoy_validate:envoy_validate_test: `envoy --mode validate` of node_bootstrap.json, edge_bootstrap.json and the ADS reconnect test's bootstrap died with SIGSEGV in Quic::ActiveQuicListenerFactory::initializeWorkerRouting(). envoyproxy/envoy#45504, in the 011e396 snapshot, moved the QUIC listener's socket options there (behind envoy.restart_features.defer_worker_routing_init, default true) and applies them to every worker's listen socket. Validation mode creates no sockets (ValidationListenerComponentFactory::createListenSocket returns nullptr), so *socket dereferences null. Upstream main still has it. The proxy-supervisor's check before every hot restart on a changed bootstrap is `envoy --mode validate`, so this would have blocked every bootstrap change in production. The patch skips a null socket, which only validation mode produces, as validation did before #45504. Regression test: envoy_validate_test in the proxy workflow, red on 8ce601a. Not reported upstream (on hold). The "FilterStateMatcherValidationError.Key: value length must be at least 1 characters" line in the same log is TestAgentCaptureListenerAndTableValidate's expected rejection ("refused as it must be"); that test passed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YacWmjoxWSZRJC38XYxuZx * proxy: aether1733's production exposure is a future static QUIC listener; refresh the extension count - The aether1733 comment (MODULE.bazel, README) overstated the exposure: the chart's bootstraps carry static clusters only (listeners come over LDS), so the supervisor's pre-restart `--mode validate` does not crash today. A future bootstrap with a static QUIC listener would fail it, and every hot restart. The crash needs concurrency > 1 (the BPF reuseport option); raw-UDP listeners are unaffected. - extensions_build_config.bzl: 354 upstream extensions - 35 dropped = 319 at 011e396. The five new ones are named; tls.certificate_selectors.dynamic_modules is dropped by the existing pattern, and the four that compile in (priority_load_shed, host_allowlist, uri_template matcher, ai_protocol_manager in-memory buffer) are unused by aether and reach none of the wasm, dynamic-module or Rust machinery, so the policy keeps them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01YacWmjoxWSZRJC38XYxuZx --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ate mode (#48982) Commit Message: quic: Fix `envoy.restart_features.defer_worker_routing_init` in config validation mode Additional Description: `envoy.restart_features.defer_worker_routing_init` moves creation and application of quic worker routing sockopt to `ActiveQuicListenerFactory::initializeWorkerRouting`, which also runs in `--mode validate`, where listeners have no sockets. Debug builds assert, opt builds dereference a null socket at concurrency > 1. Return before touching sockets in validation mode. Risk Level: Low Testing: Added unit test Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Fixes commit #45504 Signed-off-by: Filip Cacky <[email protected]>
Commit Message: quic: Defer CID generator factory and socket option init to
initializeWorkerRouting(QUIC eBPF hot restart part 0)Additional Description:
Adds
ActiveUdpListenerFactory::initializeWorkerRouting, called once when a listener is added or updated, after the listen sockets are created and before the listener starts warming.EnvoyQuicConnectionIdGeneratorFactorycreation is deferred toinitializeWorkerRouting. Creating it in theActiveQuicListenerFactoryconstructor would be too early for upcoming eBPF hot restart support, which will receive the eBPF program fd via the hot restart RPC and create a factory per reuseport group from the listen sockets.The listener init target is now registered with the server init manager after
initializeWorkerRoutinginstead of at the end of theListenerImplconstructor, so that connection ID generator factories can register init targets with the listener's init manager.Factory-specific UDP socket options were previously gathered via
ActiveUdpListenerFactory::socketOptions(). They are now created and applied ininitializeWorkerRouting.createCompatibleLinuxBpfSocketOptionnow returnsabsl::StatusOr<>instead of a bareNetwork::Socket::OptionConstSharedPtr. Initialization errors are reported through the status rather than a nullptr return. Unsupported platforms returnabsl::UnimplementedError, which callers treat as a soft failure and fall back to userspace routing, matching the previous nullptr handling. The function must return a valid socket option on success.Risk Level: High
Testing: Added test suite for
ActiveQuicListenerFactoryInitializeWorkerRoutingTestand a testcase forListenerManagerImplQuicOnlyTest. The listener_manager_impl_test and listener_manager_impl_quic_only_test suites are parameterized on the runtime guard and cover both initialization orders.Docs Changes: N/A
Release Notes: Added a minor_behavior_changes entry for the deferred initialization and its runtime guard.
Runtime guard: envoy.restart_features.defer_worker_routing_init defers QUIC connection ID generator factory creation and its packet-routing socket option from listener construction to
initializeWorkerRouting, and listener init target registration to just after it.