fix(SDK-7061): resilient TRA build-stop — retry + success-gated flag + detached watchdog - #99
Open
pri-gadhiya wants to merge 3 commits into
Open
fix(SDK-7061): resilient TRA build-stop — retry + success-gated flag + detached watchdog#99pri-gadhiya wants to merge 3 commits into
pri-gadhiya wants to merge 3 commits into
Conversation
…lag + detached watchdog) The build-stop PUT was a single best-effort request with no retry and no HTTP-status check; a transient failure, or a launcher terminated (CI cancel / kill -9 / OOM) before it was sent, left the O11Y build hanging 'running' until the ~60-min inactivity timeout. - stopBuildUpstream: 3x retry + backoff + response.ok check - buildStopped gated on stop success (recoverable by exit cleanup) - detached shutdown-watchdog survives launcher kill -9 and sends the stop; JWT from inherited env (not disk), marker 0o600 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
What is this about?
Fixes SDK-7061: WebdriverIO runs where the Test Observability / TRA build appears "stuck" and only closes via the ~60-min server-side inactivity timeout, even though the run finished.
Root cause: the build-stop (
PUT /api/v1/builds/<uuid>/stop) was sent once, best-effort — no retry, and it did not check the HTTP status. If that request failed/timed out, or the WDIO launcher was terminated (CI cancel /kill -9/ OOM) before or while it was sent, the build was never marked complete.This PR makes the build-stop resilient (verified on WebdriverIO-cucumber, before/after, including a transient stop-failure and a launcher
kill -9):stopBuildUpstreamnow retries (3× with backoff) and treats a non-2xx response as a failure (previously a non-2xx was logged as success).buildStoppedis set only when the stop actually succeeds, so a failed stop stays recoverable by the exit-cleanup path.kill -9of the launcher's process group) sends the build-stop if the launcher dies without a clean shutdown. The JWT is read from the inherited environment (never written to disk); the coordination marker is owner-only (0o600).Known boundary (out of scope here): a full container / process-group teardown that also reaps the watchdog still needs a server-side inactivity/heartbeat safeguard — tracked separately (the shared
browserstack-binarystopBuildpath has the same retry/orphan gap for binary-flow SDKs).Related Jira task/s
Release (mandatory for every PR — required for the
ready-for-reviewlabel)Version bump: (required — tick exactly one)
Release notes type: (optional)
Release notes (customer-facing): (optional but encouraged)
Release notes (internal): (required — engineer-facing; what actually changed / why)
stopBuildUpstreamhardened: 3× retry + backoff +response.okcheck (was a single best-effort PUT; non-2xx was logged as success).buildStoppedgated on stop success (was set unconditionally), so the exit-cleanup path can re-attempt a failed stop.buildWatchdog.ts/buildWatchdogMarker.ts) spawned at build start; survives a launcherkill -9, sends the stop from a separate session. JWT read from inherited env (not persisted to disk); marker file0o600, log dir0o700.Checklist
PR Validations
Run Tests: Comment RUN_TESTS to trigger sanity tests.