fix(daemon): mirror evidence into the home holding the run's lease - #12883
Merged
Conversation
`exec_via_daemon` opens a lease store for the run it is executing, then calls `mirror_daemon_evidence` to record that run's evidence. The mirror opened its own store from the environment, so the lease and the evidence it describes were resolved independently. The comment above the lease already states the invariant: a lease claimed against one home and released against another leaves the source stuck `running` with nothing alive holding it. Evidence for that same run had no such guarantee and could land in a different installation entirely. `exec_via_daemon` now resolves one set of roots and uses it for both the lease store and the mirror. Test call sites pass explicit roots via a named `test_roots()` helper.
Contributor
Homeboy Results —
|
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 #7505.
The lease and its evidence resolved separately
exec_via_daemonopens a store to hold the run's lease:and later mirrors that run's evidence:
Two independent resolutions for one execution. The comment already sitting above the lease states the invariant plainly:
Evidence for the same run had no equivalent guarantee. A repoint between the two — or any caller that later hands
exec_via_daemoninjected roots — puts the lease in one installation and the artifacts, job runs, and terminal status describing it in another. The run then looks abandoned in the home that holds its lease, while its evidence sits somewhere nobody is reading.Fix
exec_via_daemonresolves once and shares:mirror_daemon_evidencetakes the roots rather than resolving its own. It has one production caller.A note on how the test edits went
I inserted the new argument at three test call sites with a paren-matching script, which placed it after an existing trailing comma at one of them:
cargo check --workspace --tests -j2caught it (expected expression, found ,) and it is fixed. Worth recording because the two other sites had a different shape and were fine — a script that is right twice can still be wrong once, which is the argument for running the gate rather than trusting the edit.Verification
cargo check --workspace --tests -j2— clean, 3m20s, zero errors.Remaining in this file
evidence/mirror.rsstill has seven ambient entry points (mirror_reverse_broker_evidence,mirror_daemon_job_progress,refresh_mirrored_daemon_evidence, and others). Each is reachable from a different caller, so they want their own increments rather than one sweep — this one is the pair where the split was demonstrably load-bearing.