You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Backgrounded/no-TTY reflex run ignores SIGTERM/SIGINT — requires SIGKILL of the process group #6980
When reflex run is started without a controlling TTY (backgrounded under setsid with output redirected — the shape of CI jobs, containers, and process supervisors), it does not exit on SIGTERM or SIGINT. The only reliable way to stop it is SIGKILL of the whole process group. Since systemd/docker/k8s stop services with SIGTERM, this means no graceful shutdown in exactly the environments that rely on it.
To Reproduce
reflex init --template blank
setsid reflex run --frontend-port 3140 --backend-port 8140 > server.log 2>&1&# wait for the app to come up, then:kill -TERM <reflex pid># process keeps runningkill -INT <reflex pid># still runningkill -KILL -- -<pgid># only this stops it (note: the launcher pid and the setsid pgid differ)
Observed behavior
The server (and its bun/node frontend children) keeps running after SIGTERM and SIGINT; SIGKILL of the process group is required. Observed consistently across many independent app runs during pre-release testing (Linux container, dev mode).
Expected behavior
SIGTERM/SIGINT terminate reflex run (and its child process tree) promptly and gracefully regardless of whether a TTY is attached.
Specifics (please complete the following information):
Python Version: 3.11
Reflex Version: 0.9.9a1
OS: linux
Additional context
The same no-TTY launch recipe was used for 0.9.8 baseline runs in the same environment with the same result, so this does not appear to be a 0.9.9a1 regression.
Related but distinct: interactive (TTY-attached) reflex run does shut down on SIGTERM — that path instead logs spurious ERROR records on shutdown (filed separately).
Found during 0.9.9a1 pre-release testing; rerun instructions documenting the SIGKILL requirement are on branch claude/reflex-prerelease-testing-t0sd90 under prerelease-testing/2026-08-27-v0.9.9a1/up_upload_clock/.
Activity
linear-code commentedon Aug 28, 2026
ENG-11819
fix: terminate the frontend process tree when reflex run shuts down
fix: terminate the frontend process tree when reflex run shuts down