fix: restore phone-home diagnostics in warm-pool download step#62
Merged
Conversation
buildReusableUserData()'s RUNNER_DOWNLOAD heredoc (the reuse: stop cold-boot path) dropped the ERR trap before entering the sudo -u runner shell and never re-included PHONE_HOME_HELPERS or re-armed the trap inside it, unlike buildUserData()'s plain-path RUNNER_BOOTSTRAP equivalent. Functions and traps don't survive the sudo -u boundary, so any curl/sha256sum/tar failure during the warm-pool download step was silent: no failed:downloading bootstrap tag, just a stall until the external GitHub registration timeout. Re-include PHONE_HOME_HELPERS inside the RUNNER_DOWNLOAD heredoc and re-arm the ERR trap for the downloading phase before the download/ verify sequence, mirroring the plain path line for line. Adds regression tests scoped to the RUNNER_DOWNLOAD heredoc body so they can't be satisfied by the outer shell's or register script's traps. Fixes #61 Signed-off-by: kurok <22548029+kurok@users.noreply.github.com>
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.
Summary
buildReusableUserData()(thereuse: stop/ warm-pool cold-boot script) dropped the bootstrapERRtrap before the runner-download step and never re-established phone-home diagnostics inside that step's innersudo -u runnershell — unlikebuildUserData()'s plain-path equivalent, which does both. Functions and traps don't survive thesudo -uboundary, so anycurl/sha256sum/tarfailure inside the warm-poolRUNNER_DOWNLOADheredoc was completely silent: nofailed:downloadingbootstrap tag, andmode: startjust ran out the registration-timeout clock with nothing to show for it.Fixes #61
Fix
PHONE_HOME_HELPERSinside theRUNNER_DOWNLOADheredoc.GH_RUNNER_STEP=downloadingand re-armtrap 'gh_runner_phone_home "failed:${GH_RUNNER_STEP}"' ERRinside that heredoc, before the download/verify sequence — mirroringbuildUserData()'sRUNNER_BOOTSTRAPheredoc line for line.configuringphase (GH_RUNNER_STEP=configuring+ trap now armed immediately afterPHONE_HOME_HELPERS, ahead of theIMDS/config.shprep lines) for consistency.Tests added
New regression tests in
tests/warmpool.test.js, scoped to theRUNNER_DOWNLOADheredoc body specifically (via a helper that extracts just that heredoc's contents) so they can't be satisfied by matches elsewhere in the script — e.g. the outer root shell'spreparingtrap or the register script'sconfiguringtrap:re-includes PHONE_HOME_HELPERS inside the RUNNER_DOWNLOAD heredoc (regression, #61)arms an ERR trap for the downloading phase inside the RUNNER_DOWNLOAD heredoc (regression, #61)— also asserts ordering:GH_RUNNER_STEP=downloadingand the trap must be set before thecurl -fsSLodownload call.Verification
npm test— 17 suites / 226 tests, all passing.npm run lint— clean, no findings.npm run package— rebuiltdist/index.js;git status --porcelain -- dist/confirmed the working-treedist/already matched a fresh build (no drift beyond the intended 8-line diff mirroring thesrc/aws.jschange). Onlydist/index.jschanged; the code-splitdist/*.index.jschunk files are untouched by this fix.Review findings
A code review pass was run against this change; no findings were reported (
confirmedCount: 0, no fixes needed/applied).