Repository navigation
feat(supervisor): export the restart epoch to each Envoy child (#1333) - #1366
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
An allowed extra restart-epoch argument can make the exported value differ from Envoy’s effective epoch.
2 open findings
What changed in this PR
Exports each Envoy child’s restart epoch for future per-generation access-log attribution under #1333.
Changes:
- Adds a sanitized
AETHER_RESTART_EPOCHchild environment variable. - Tests initial starts, hot restarts, handoffs, and stale environment values.
- Registers the new test file with Bazel.
| File | Description |
|---|---|
agent/internal/proxy/hotrestart/supervisor.go |
Exports the child epoch. |
agent/internal/proxy/hotrestart/childenv_test.go |
Tests epoch propagation. |
agent/internal/proxy/hotrestart/BUILD.bazel |
Includes new tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
bpalermo
force-pushed
the
feat/supervisor-restart-epoch-env
branch
from
October 7, 2026 22:48
dded315 to
ea92ef9
Compare
Every Envoy child is now started with AETHER_RESTART_EPOCH set to its own --restart-epoch value, so an access-log format can name the generation that wrote a row with %ENVIRONMENT(AETHER_RESTART_EPOCH)%. The child keeps the supervisor's whole environment, as before. Any AETHER_RESTART_EPOCH the supervisor itself inherited is dropped first, so a stale value can never name the wrong generation. There is one place a child is built (buildEnvoyCmd, called only from hotRestart), so the first start, an in-pod hot restart and a cross-pod handoff at predecessor+1 all get the number passed on the command line. Part of #1333 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
bpalermo
force-pushed
the
feat/supervisor-restart-epoch-env
branch
from
October 7, 2026 23:07
ea92ef9 to
a140ccb
Compare
This was referenced Oct 7, 2026
…; the test comment claims no consumer Review on #1366. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is correct and comprehensively tested; the remaining feedback is documentation-only.
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.
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.


Part of #1333
What changes
The proxy supervisor now starts every Envoy child with
AETHER_RESTART_EPOCH=<n>in its environment, wherenis the--restart-epochvalue passed to that same child. It is the number Envoy exports asenvoy_server_hot_restart_epoch.Nothing reads the variable yet. The access-log change for #1333 (a separate pull request, mergeable in either order) reads it with
%ENVIRONMENT(AETHER_RESTART_EPOCH)%, so each row names the proxy generation that wrote it.How
buildEnvoyCmdsetscmd.Envto the supervisor's own environment plus this one variable. The child inherited the supervisor's environment before (nocmd.Env), and still gets all of it.AETHER_RESTART_EPOCHthe supervisor itself inherited is removed before the new one is added, so there is exactly one entry and a stale value cannot win.buildEnvoyCmdis the only place a child is built, andhotRestartis its only caller. The first start, an in-pod hot restart and a cross-pod handoff (attach at predecessor + 1) therefore all export the number that is on the command line.validateConfig(envoy --mode validate) is unchanged: it is not a serving child and has no epoch.Tests
TestChildEnv: the helper, including a stale value, several stale values, and a variable that only shares the prefix.TestBuildEnvoyCmdExportsRestartEpoch: the command the supervisor builds carries the epoch once, equal to its--restart-epoch, with the inherited environment intact.TestEnvoyChildSeesItsRestartEpoch: real child processes, withAETHER_RESTART_EPOCH=99in the supervisor's environment, record what they see. First start and in-pod hot restart give0 0and1 1; a cross-pod handoff over a predecessor at epoch 6 gives7 7.Measured: with the one production line removed, the last two tests fail (
"0 99", "1 99"and"7 99"); with it, the package passes, also under--config=race.//agent/cmd/proxy-supervisor:deps_testandscripts/check-proxy-supervisor-deps.shpass; no dependency was added (stringsandstrconvonly). No chart change.Not verified here: a real Envoy reading the variable. That is covered by the live test in the access-log pull request.
🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr