Skip to content

fix(cli): Exit 124 when local run --timeout stops the app - #2434

Merged
MathurAditya724 merged 3 commits into
mainfrom
fix/local-run-timeout-exit
Nov 19, 2026
Merged

MathurAditya724 merged 3 commits into
mainfrom
fix/local-run-timeout-exit

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

When --timeout stopped the app, sentry local run exited with whatever the app returned on SIGTERM. Most apps gave 143 plus an error, a SIGKILL escalation gave 137, and apps that exit cleanly on SIGTERM, like next dev, gave 0, so a timeout looked like a success.

Now a timeout always exits 124, like GNU timeout, and prints a short note instead of an error. An app that exits on its own before the timeout keeps its exit code, and so does one you already stopped with Ctrl-C. --verify timeouts still exit 64. The help, the local docs and the exit code reference cover 124.

Before:

$ sentry local run --timeout 3 -- next dev
$ echo $?
0

After:

$ sentry local run --timeout 3 -- next dev
Stopping after 3s (--timeout)…
Stopped after 3s (--timeout)
$ echo $?
124

via @MathurAditya724.

--

View Session [Sentry]

When `--timeout` stopped the app, `local run` exited with whatever the
app returned on SIGTERM: 143 with an error for most apps, 137 after a
SIGKILL escalation, and 0 for apps such as `next dev`, so a timeout
looked like success.

Exit 124 whenever the timeout stops the app, as GNU `timeout` does, and
print one line instead of an error. An app that exits first keeps its
code, and `--verify` timeouts still exit 64.

Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cli Ready Ready Preview Nov 19, 2026 7:21pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 19, 2026 7:21pm UTC

Request Review

If the user already stopped the app and it is still shutting down when
the --timeout timer fires, let it finish and keep its exit code instead
of exiting 124. Print "Stopping after Ns (--timeout)…" when the timer
fires, so an app that ignores SIGTERM isn't silent until the SIGKILL.

List 124 and 252 as shell conventions in the exit code ranges.

Co-Authored-By: Aditya Mathur <57684218+MathurAditya724@users.noreply.github.com>

@MathurAditya724 MathurAditya724 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the updated head with main after #2433. Typecheck, lint and the full workspace suite pass. Independent real CLI checks confirm exit 124 for normal SIGTERM, clean SIGTERM handlers and SIGKILL escalation; an app exiting naturally keeps exit 7; verify timeout stays 64; Ctrl-C before timeout keeps a clean exit even when shutdown crosses the deadline. Child processes are reaped. The updated test passes the ready-file path as an argument. No actionable findings.

@MathurAditya724
MathurAditya724 merged commit 675bd66 into main Nov 19, 2026
31 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/local-run-timeout-exit branch November 19, 2026 19:49

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – cli — ae938510 Deployed Nov 19, 2026 by vercel[bot]
Preview – sentry-local — ae938510 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants