Repository navigation
fix(supervisor): --envoy-arg rejects at startup what the pinned Envoy would reject at every fork (#1407, #1408, #1409) - #1433
Conversation
… would reject at every fork (#1407, #1408, #1409) The startup check now refuses, with an error that names the argument: - a flag and its value in one item (--flag=value, -f=value, -fvalue): the pinned Envoy answers "Couldn't find match for argument" for every flag (#1407). The error shows the two-item form. - a --concurrency with a missing or unusable value (#1408). 0 is accepted and read as one worker, which is what Envoy runs for it. - flags the supervisor does not pass but that break a handoff or stop Envoy from serving: --use-dynamic-base-id, --disable-hot-restart, --socket-path, --hot-restart-version, --version, -h/--help, -- and --ignore_rest (#1409). --base-id-path is harmless and stays allowed. - a second one of any flag the chart passes through --envoy-arg. //agent/test/envoyargs runs the same arguments through the pinned Envoy, so a pin bump that changes the parser fails a test. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟡 Changes recommended
The remediation message and documentation prescribe an invalid extra value for valueless Envoy flags.
2 open findings
What changed in this PR
Strengthens proxy-supervisor startup validation so invalid Envoy arguments fail before the first fork.
Changes:
- Rejects unsupported argument spellings, invalid concurrency values, duplicates, and handoff-breaking flags.
- Aligns concurrency handling with pinned Envoy behavior.
- Adds unit and pinned-Envoy tests plus documentation.
| File | Description |
|---|---|
docs/configuration.md |
Documents validation rules and limitations. |
agent/test/envoyargs/envoyargs_test.go |
Verifies behavior against pinned Envoy. |
agent/test/envoyargs/BUILD.bazel |
Defines the pinned-Envoy test target. |
agent/internal/supervisorcmd/supervisor.go |
Updates validation guidance and help text. |
agent/internal/supervisorcmd/flags_test.go |
Expands CLI and chart validation tests. |
agent/internal/proxy/hotrestart/envoyargs.go |
Implements argument validation. |
agent/internal/proxy/hotrestart/envoyargs_test.go |
Tests argument parsing and rejection rules. |
agent/internal/proxy/hotrestart/concurrencychange.go |
Aligns concurrency extraction with Envoy. |
agent/internal/proxy/hotrestart/concurrencychange_test.go |
Covers new concurrency semantics. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
…o go alone The spelling error advised two items for every flag. For a flag that takes no value the second item is refused by Envoy too, so the advice for the pinned Envoy's switch flags is now the flag alone. //agent/test/envoyargs checks each of them against the binary. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🔵 Needs a closer look
The startup gate directly affects every proxy launch and hot-restart handoff, while end-to-end cluster behavior was not verified.
0 open findings
2 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
There was a problem hiding this comment.
🟢 Approval recommended
The validation behavior is consistent, documented, and comprehensively tested against the pinned Envoy binary.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.


Closes #1407
Closes #1408
Closes #1409
Follow-up to #1399. The supervisor checks
--envoy-argonce at startup. This PR makes that check refuse three more kinds of argument, each decided from what the pinned Envoy does.What changed
--concurrency=2,-l=info,-linfo) is a startup error. The error shows the two items to pass instead, for example--envoy-arg=--concurrency --envoy-arg=2.--concurrencyvalue. A missing value, a non-number, a negative number, an empty string and a flag standing where the value should be are startup errors that nameproxy.concurrency.--concurrency 0is accepted and counted as 1 worker, because that is what Envoy runs for it.--use-dynamic-base-idis now reserved.--base-id-pathstays allowed, because it is harmless. I also reserved--disable-hot-restart,--socket-path,--hot-restart-version,--version,-h/--help,--and--ignore_rest. Each error says why.--envoy-argis refused when given twice:--concurrency(as before),-l/--log-level,--service-cluster,--service-node,--service-zone,--drain-strategyand--skip-hot-restart-parent-stats.concurrencyArg, which the handoff reads, follows the same rules:--concurrency=Nis an error and0is1.docs/configuration.mdlists the rules, and the--envoy-arghelp text says the same.Nothing under
charts/changed. No dependency was added.Design
The one list from #1399,
reservedEnvoyFlagsinagent/internal/proxy/hotrestart/envoyargs.go, stays the single place for refused flags. Each new entry carriesconflict: true, which means "the supervisor does not pass this flag; it is refused for what it does". Both drift tests from #1399 are kept:TestEveryFlagTheSupervisorPassesIsReservedis unchanged.TestReservedFlagsAreAllPassedOrAliasesnow holds aconflictentry to the opposite rule (the supervisor passes none of its spellings), so neither kind can be labelled as the other.The allowed-once flags are a second, small table (
onceEnvoyFlags).TestChartEnvoyArgFlagsAreAllowedOncereads the flags off the chart template and fails if the chart passes one that is not in it.New test target
//agent/test/envoyargsruns the same arguments through the pinned Envoy and through the check. A pin bump that changes Envoy's parser (for example, one that starts to accept--flag=value) fails there. It takes 4.3 s.Measured on the pinned Envoy
Binary: the one behind
//agent/test/envoybin:envoy_bin(8eafebb8…/1.40.0-dev). Parser runs used--mode validate -c <minimal bootstrap>. Handoff runs started two real Envoys with the same--base-id, epoch 0 then epoch 1.#1407. The
=spelling is refused for every flag I tried (17), not for some.--concurrency=2,--service-node=n1,--service-cluster=x,--log-level=info,--drain-strategy=gradual,--log-format=%v,--component-log-level=upstream:debug,--stats-tag=a:b,--socket-mode=600,--log-path=/dev/null,--local-address-ip-version=v4,--file-flush-interval-msec=100,--config-yaml={},--disable-extensions=foo,--skip-hot-restart-parent-stats=truePARSE ERROR: Argument: <item>Couldn't find match for argument-l=info,-linfo-l info,--log-level info,--concurrency 2--service-node -c,--service-node --x=y,--log-format '--base-id=%v'#1408.
--concurrencyvalues. The "workers" column is/server_infoconcurrencyof a serving Envoy, confirmed by countingwrk:worker_*threads.2,020concurrency_ = std::max(1U, value)inoptions_impl.cc)Missing a value for this argument!x,2x,1.5,0x2,2(trailing space),4294967296Couldn't read argument value from string '…'-l info,--skip-hot-restart-parent-statsas the valueCouldn't read argument value from string '-l'-1+2,2(leading space)4294967295So
0is not "one per core" and is not an error in Envoy. I kept it legal and made the handoff logic read it as 1, instead of refusing a command line that works today.#1409. Base id and the other hot-restart flags. Read in the Envoy source at the pin (
726d7ac):source/server/options_impl.ccandsource/exe/stripped_main_base.cc(configureHotRestarter).--use-dynamic-base-id--base-idand picks a random one. It throws when the restart epoch is above 0.--base-id 4242, the epoch-0 Envoy chose base id 76596540 (its shared memory was/dev/shm/envoy_shared_memory_765965400). Its epoch-1 successor exited withcannot use --restart-epoch=1 with --use-dynamic-base-id. A successor without the flag looped onhot restart sendmsg() connection refused.--base-id-path4242after epoch 0 and after epoch 1, and the handoff completed (the parent was terminated by the child).--disable-hot-restart--socket-path@envoy_domain_socket.connection refusedand never initialized.--socket-mode@.--hot-restart-version,--version,-h/--helpNoServingException.--/--ignore_rest-- --concurrency 1ran 20 workers.--skip-hot-restart-parent-statsArgument already set!.proxy.hotRestart.skipParentStats)--skip-hot-restart-on-no-parent--drain-strategyArgument already set!.--cpuset-threads--drain-time-s,--parent-shutdown-time-s,--restart-epoch,--base-id,--admin-address-path,--mode,-cenvoy --helplists no other admin or drain flag. The admin address comes from the bootstrap.Red, then green
The new tests in
agent/internal/supervisorcmd/flags_test.goand//agent/test/envoyargsuse only the existing entry points, so I ran them againstmain'senvoyargs.goandconcurrencychange.gofirst:TestEnvoyArgRejectsSpellingsEnvoyDoesNotParse8 of 8,TestEnvoyArgRejectsABadConcurrencyValue8 of 8,TestEnvoyArgRejectsFlagsThatBreakAHandoff9 of 9,TestEnvoyRefusesWhatTheCheckRefuses30 of 35 (the other 5 were already refused),TestCheckIsStricterThanEnvoyOnPurpose12 of 12, plusTestChartEnvoyArgFlagsAreAllowedOnceand the changed line ofTestEnvoyArgConcurrencyOnceOnly.The new tests inside the
hotrestartpackage use new unexported names, so they do not compile againstmain. I did not run those red. Instead I applied three temporary mutations and saw each one caught:--base-idmarkedconflictand--socket-pathunmarked (both caught byTestReservedFlagsAreAllPassedOrAliases, the second also byTestCheckExtraArgsRefusesWhatBreaksAHandoff), and--drain-strategyremoved fromonceEnvoyFlags(caught byTestChartEnvoyArgFlagsAreAllowedOnce).The chart still passes
TestChartEnvoyArgsPassTheCheckpasses. It needed one change: it feeds template source to the check, and the item after--concurrencyis the template action{{ . }}, which the new value rule would refuse. The test now stands2in for it, and fails if that item stops being a template action.helm templateofcharts/aether(helm 3.18.4), proxy container--envoy-argitems, run throughcheckEnvoyArgsin a temporary test (not committed) and through the pinned Envoy in validate mode:-l info --service-cluster aether-proxy --service-node $(NODE_NAME) --service-zone $(ZONE) --drain-strategy gradual. Accepted by both.proxy.concurrency=2,proxy.hotRestart.skipParentStats=true,proxy.hotRestart.hotRestartOnConcurrencyChange=true,proxy.hotRestart.baseId=3,proxy.logLevel=debug,otel.endpointset: the same plus--concurrency 2 --skip-hot-restart-parent-stats. Accepted by both.$(NODE_NAME)expanded and an empty$(ZONE): accepted by the check.Other checks
bazel test //agent/test/envoyargs:all //agent/internal/supervisorcmd:all //agent/internal/proxy/hotrestart:all //agent/cmd/proxy-supervisor:allpasses, includingdeps_test.scripts/check-proxy-supervisor-deps.shpasses.go_testtargets pass under--config=race.fail_on_violationover//...andmake format-checkpass.make gazellechanged nothing.Existing test cases I changed
Four expectations, each because the issue asks for the opposite:
TestConcurrencyArg:--concurrency=4expected4, now an error (supervisor: --envoy-arg=--concurrency=2 passes the startup check, but the pinned Envoy does not accept --flag=value and every fork fails #1407).--concurrency 0expected an error, now1(supervisor: a lone --concurrency with a bad or missing value is not a startup error #1408).TestCheckExtraArgs:--concurrency=2and a lone--concurrencymoved from the accepted list to a refused list.TestEnvoyArgConcurrencyOnceOnly:--concurrency=2 -l infowas required to pass, now required to fail.No case was removed.
Limits, and what I did not verify
--service-nodenamed-c, a--log-formatthat is--x=yor that starts with-lor-c. A value that only contains=, or starts with a dash and a space, is fine.+2, a leading space, the empty value, negative values and values above 2147483647. Envoy accepts all of them.--socket-pathis reserved on the evidence of a mismatch between two Envoys. A deployment that set the same abstract path on every pod from the start would hand off fine and is refused too. I judged the roll that introduces the flag to be the real risk.--skip-hot-restart-on-no-parent: I only measured the case with no shared memory at all. I did not build the case where the shared memory exists and the parent is gone, which is where the flag differs.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr