Repository navigation
fix(smoke): retry a failed attempt again (0.19.2) - #26
Conversation
0.19.1's attempt loop called `smoke; rc=$?`. orun runs a step's script under `bash -e`, so the first failing attempt ended the step with the smoke's own exit code: no "attempt 1/10 failed" line, no backoff, no second attempt. A first deploy whose new workers.dev route 404s for a few seconds then failed smoke in 0.3s with curl's exit 22 (multi-tenant-saas-2's console, stage and prod, 2026-11-16), and only a manual rerun got it green. The call is now `rc=0; smoke || rc=$?`, which errexit does not apply to, so the ~4.5 minute budget and the exit-code log line work as $2 meant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4107f549e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| smoke; rc=$? | ||
| # Not `smoke; rc=$?`: orun runs a step under `bash -e`, so a bare failing | ||
| # call would end the step on attempt 1 and skip the whole retry budget. | ||
| rc=0; smoke || rc=$? |
There was a problem hiding this comment.
Preserve failures from multi-command smoke scripts
When a configured smokeCommand has multiple commands and relies on the step's bash -e (for example, a failed check followed by a successful logging command), calling smoke on the left of || makes Bash ignore errexit throughout the function's subshell. The later command can make the attempt return 0, so the loop reports a broken deployment as healthy instead of retrying or failing. Preserve errexit for the smoke body while capturing its status.
Useful? React with 👍 / 👎.
Bug:
0.19.1turned the smoke retry loop intosmoke; rc=$?. orun runs a step underbash -e, so the first failing attempt ends the step on the spot. There's no "attempt 1/10 failed" line, no backoff and no second attempt. Since #24 every Worker smoke is a single try.Seen: vijayakrishnans/multi-tenant-saas-2, 06-console, run 43861505573 attempt 1. On both stage and prod the console deployed, then smoke failed 0.3s later with curl exit 22 (the brand-new workers.dev route still 404'd). A manual rerun passed and both URLs serve 200.
Fix:
rc=0; smoke || rc=$?in the worker, worker-turbo and workers-assets-turbo verify-deploy jobs. errexit doesn't apply to a command on the left of||. Version 0.19.2.Checked: I pulled the loop out of the job and ran it under
bash -e -c 'set -uo pipefail; …'with a smoke that fails twice: it logs attempts 1 and 2 with their exit codes and passes on attempt 3. Before the fix the same harness exits on attempt 1 with no log line.After merge: tag
v0.19.2so release.yml publishes the OCI artifact. Baselines pinned to 0.19.1 need their pin bumped to pick it up.🤖 Generated with Claude Code