Repository navigation
fix: spored install race (#27) + single-instance --check-complete (#26) - #28
Merged
Merged
Conversation
) #27 — spored install "Text file busy": The user-data bootstrap downloaded spored directly over /usr/local/bin/spored with `curl -o`. If a spored was already running (baked into the AMI or from a prior boot) the write failed with ETXTBSY, and because the script runs under `set -e`, cloud-init marked the entire user-data — including the user's appended script — as failed. - Download to a temp file, verify the checksum there, then `systemctl stop spored` and atomically `mv` into place. rename(2) over a busy binary is permitted (the running process keeps the old inode), so no ETXTBSY. - Run the custom user-data section under `set +e` so a non-fatal bootstrap warning no longer skips the user's script. #26 — `spawn status --check-complete` always exited 0 for single instances: The standardized exit codes (0/1/2/3) were only implemented for sweeps; the instance path SSHed in, printed `spored status`, and returned nil. - Add `--check-complete` to spored's `status` subcommand: inspects the completion file and exits 0=complete, 1=failed (JSON status), 2=running (absent), 3=error. Logic factored into checkCompleteCode for testing. - `spawn status --check-complete <instance>` now forwards the flag over SSH and propagates spored's exit code (mapping SSH's 255 to 3). Tests: checkCompleteCode covers absent/empty/success/failed/non-JSON.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced May 31, 2026
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.
Two bugs blocking aws-microbiome-demo.
#27 — spored install "Text file busy"
The user-data bootstrap downloaded spored directly over
/usr/local/bin/sporedwithcurl -o. If a spored was already running (baked into the AMI or from a prior boot), the in-place write failed withETXTBSY— and since the bootstrap runs underset -e, cloud-init marked the entire user-data (including the user's appended script) as failed.systemctl stop spored→ atomicmvinto place.rename(2)over a busy binary is allowed (the running process keeps the old, now-unlinked inode), so noETXTBSY.set +eso a non-fatal bootstrap warning no longer skips the user's script.#26 —
spawn status --check-completealways exited 0 for single instancesThe standardized codes (0/1/2/3) were only wired for sweeps; the instance path just SSHed in, printed
spored status, and returned nil → always exit 0.--check-completeto spored'sstatussubcommand: inspects the completion file and exits0=complete,1=failed (JSONstatus),2=running (absent),3=error. Decision logic factored intocheckCompleteCodefor unit testing.spawn status --check-complete <instance>forwards the flag over SSH and propagates spored's exit code (SSH-level 255 → 3).This makes the documented contract real; the docs PR (#347) currently warns it's sweep-only and can be updated once this ships.
Tests
checkCompleteCodecovers absent/empty/success/failed/non-JSON. Build + vet green across spawn and spored.