Repository navigation
fix: signal completion only after task, with real exit status (#24) - #25
Merged
Merged
Conversation
The staging script ran 'spored complete --status success' UNCONDITIONALLY
(2>/dev/null, no set -e), so a 'success' completion was signaled regardless
of whether the task succeeded, failed, or had meaningfully run — tasks
appeared complete (and successful) moments after boot, and
'spawn status --check-complete' returned 0 immediately.
Correction to the issue's hypothesis: spawn's bootstrap does NOT create
/tmp/SPAWN_COMPLETE (it only watches it). The JSON {"status":"success"}
the reporter saw is exactly what THIS line wrote — the bug was here, not in
spored's boot sequence.
Fix: capture the task exit code (TASK_RC) and signal success/failed
accordingly, as the genuine last step after outputs sync. spored complete
--status failed makes --check-complete return 1, so Nextflow sees a real
pass/fail instead of a spurious early success.
Spock spec asserts status is derived from TASK_RC (not hard-coded success),
the unconditional 'spored complete --status success' is gone, and the
signal is strictly last.
Fixes #24
Merged
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.
Fixes #24.
Correction to the issue's root-cause hypothesis
The issue says spored's bootstrap creates
/tmp/SPAWN_COMPLETE. I checked spawn's code: the bootstrap does NOT create it — it only watches it. The JSON{"status":"success"}the reporter saw is exactly whatspored complete --status successwrites, which is nf-spawn's own staging script (line 216), not spored's boot.The actual bug
The staging script ran:
unconditionally — with
set -uo pipefail(noset -e), the script never aborts on a failed/short-circuited task, so it always reached this line and signaled success. Result:spawn status --check-completereturned 0 (complete, success) moments after boot, regardless of the task's real state.Fix
Capture the task's exit code and signal the real outcome as the genuine last step:
spored complete --status failedmakes--check-completereturn 1, so Nextflow sees a genuine pass/fail instead of a spurious early success.Test
Spock spec asserts the status is derived from
TASK_RC(not hard-coded success), the unconditional--status successis gone, and the signal is strictly the last step../gradlew testgreen (8 tests).