Repository navigation
feat(cfg): add DISABLE_STARTUP_RECLAIM flag #3081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 The new
DisableStartupReclaimfield (envDISABLE_STARTUP_RECLAIM) is declared atpackages/orchestrator/pkg/cfg/model.go:84but never read anywhere in the repo — a grep forDisableStartupReclaim/DISABLE_STARTUP_RECLAIMmatches only the declaration and the new env-parsing test. The PR description says the field "is used to gate the startup resource-reclaim routine," but no startup-reclaim routine exists and no code consultsConfig.DisableStartupReclaim, so settingDISABLE_STARTUP_RECLAIM=trueis a silent no-op. Either land the consumer in this PR or note in the description that the flag is currently inert pending a follow-up.Extended reasoning...
What the bug is\n\nThis PR adds
Config.DisableStartupReclaimbound toDISABLE_STARTUP_RECLAIMatpackages/orchestrator/pkg/cfg/model.go:84, plus a test atpackages/orchestrator/pkg/cfg/model_test.go:83-89that only verifies the env tag parses. The PR description claims the field "is used to gate the startup resource-reclaim routine" (present tense), but no consumer of the field is present in this PR or in the post-merge tree.\n\nEvidence (repo-wide grep)\n\nA repo-wide search for both identifiers returns only three lines — all in this PR:\n\n\npackages/orchestrator/pkg/cfg/model.go:84: DisableStartupReclaim bool `env:"DISABLE_STARTUP_RECLAIM"`\npackages/orchestrator/pkg/cfg/model_test.go:84: t.Setenv("DISABLE_STARTUP_RECLAIM", "true")\npackages/orchestrator/pkg/cfg/model_test.go:88: assert.True(t, config.DisableStartupReclaim)\n\n\nNoc.DisableStartupReclaimread exists anywhere. Searching for any "startup reclaim" routine also turns up nothing. The only reclaim machinery inpackages/orchestratorissandbox.bestEffortReclaim(pkg/sandbox/reclaim.go:83), invoked per-sandbox during pause/snapshot frompkg/sandbox/sandbox.go:1195, and it is gated by a LaunchDarkly feature flag (featureflags.GetReclaimConfig) — not by anything inConfig. Thecmd/resume-buildCLI exposes its own--reclaimflag.Bool, again unrelated to this Config field. There is no startup-time reclaim path that this knob could plausibly gate.\n\nContrast with sibling field\n\nThe adjacentConfig.ForceStopfield is consumed inpackages/orchestrator/pkg/factories/run.go(and surfaced in the job template HCL).DisableStartupReclaimhas no analogous consumer in either code or IaC.\n\nStep-by-step proof of the no-op\n\n1. Operator setsDISABLE_STARTUP_RECLAIM=trueexpecting to skip a startup reclaim pass, as the PR title and description advertise.\n2. Orchestrator boots.cfg.Parse()runs andconfig.DisableStartupReclaimis correctly parsed totrue— the new test confirms only this.\n3. The orchestrator proceeds with the rest of startup. No code path readsconfig.DisableStartupReclaim, so nothing is skipped, suppressed, or otherwise altered.\n4. Net effect: behavior is identical to theDISABLE_STARTUP_RECLAIMunset case. The operator gets no warning that their flag did nothing.\n\nImpact\n\nShipping an advertised operator-facing switch that silently no-ops is a footgun: anyone who flips it expecting the documented behavior will be misled. The test also gives a false sense of coverage — it only checks the tautology that env parsing works, not that any routine is actually gated.\n\nHow to fix\n\nEither (a) include the consumer that readsconfig.DisableStartupReclaim(and the startup reclaim routine it gates) in this PR, or (b) explicitly note in the PR description / a code comment that the flag is currently inert and is being landed ahead of a follow-up. Option (b) is acceptable as prep, but the present-tense claim in the description should be softened to match reality.\n\nAddressing the duplicate-refutation\n\nOne verifier refutedbug_004as a duplicate ofbug_001. That refutation is correct in the sense that the two reports describe the same defect — and the synthesis layer has already merged them into a single finding (this one). The merged report carries forward the strongest framing from both: the dead-config observation, the absence of any startup-reclaim routine to gate, and theForceStopcounter-example frombug_004. No double-reporting occurs — this is a single comment about a single field.