Repository navigation
fix: a headless pass that never opened its source exits non-zero - #13
Merged
Merged
Conversation
`xtce-gs run --headless --record pass.dat` under a supervisor exited 0 after a
second having recorded nothing, and a cron wrapper or a `set -e` script carried
on as though the pass had happened. Three endings collapsed onto one exit code:
a replay that reached the end of its file (which is a success), a source that
could not be opened, and a source that died mid-pass and did not come back.
The split was arbitrary from the operator's side, which is what makes it a bug
rather than a policy: a missing *definition* already exited 1, because it is
opened on the caller's thread, while a missing *recording* exited 0, because it
is opened one spawn later inside the acquisition task. Two spellings of the
same mistake, two different exit codes.
`Session::is_running` answers whether acquisition stopped. `Session::outcome`
now answers which ending — Ended, Stopped, SourceFailed, DecoderGone — recorded
at each of the task's exits, first writer winning because a source that dies is
also a queue that then drains. Two of those are failures and `headless` reports
them as `CliError::Pass`.
Measured, before and after:
replay --headless mission.xml no-such-file.dat 0 -> 1
run --headless --source tcp://127.0.0.1:1 … 0 -> 1
a replay that decodes all 7200 packets 0 -> 0
542 tests, fmt and clippy clean.
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.
xtce-gs run --headless --record pass.datunder a supervisor exited 0 after a secondhaving recorded nothing. A cron wrapper or a
set -escript carried on as though the pass hadhappened, and
Restart=on-failurenever fired.Three endings collapsed onto one exit code: a replay that reached the end of its file (a
success), a source that could not be opened, and a source that died mid-pass and did not come
back.
What makes it a bug rather than a policy is that the split was arbitrary from the operator's
side. A missing definition already exited 1, because it is opened on the caller's thread. A
missing recording exited 0, because it is opened one
spawnlater inside the acquisitiontask. Two spellings of the same mistake — a file I named on the command line is not there —
and nothing a user could predict separates them.
Session::is_runninganswers whether acquisition stopped.Session::outcomenow answerswhich ending:
Ended,Stopped,SourceFailed,DecoderGone, recorded at each of thetask's exits. First writer wins, because a source that dies is also a queue that then drains,
and the first ending is the one that explains the pass. Two of them are failures, and
headlessreports those asCliError::Pass.Measured before and after:
replay --headless mission.xml no-such-file.datrun --headless --source tcp://127.0.0.1:1 …Found by a review sweep looking for the class of defect that 536 passing tests missed twice
today; confirmed by running it. 542 tests, fmt and clippy clean.