`reflex run --json` ignores SIGINT sent to its pid; under supervisord stopsignal=INT the app is orphaned and blocks the restart
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in packages/reflex-base/src/reflex_base/utils/log.py, especially the SIGTERM forwarding at line 519 and the KeyboardInterrupt handling at lines 520–526. Check how the supervising process waits for and signals its child, then reproduce with reflex run --json and SIGINT sent to its pid. Done means the child exits promptly and the server does not remain running; rerun the issue’s repro matrix to check the behavior.
Written by the indexing model from the issue text.
Description
Severity: LOW, pre-existing. 0.10.0a2 behaves like a3; 0.9.12 also needs a SIGKILL, but there nothing survives it. Confirmed by an independent verifier (pre-release finding A3-07).
Symptom. kill -INT <pid> of reflex run --json does nothing: the server is still serving 12–210 s later. Every other way of stopping it works quickly:
| stop method | time to exit |
|---|---|
plain reflex run, SIGINT |
0.18–0.25 s |
--json, SIGTERM to the pid |
0.29 s–2 s |
--json, SIGINT to the process group (Ctrl-C) |
0.27 s |
--json, SIGINT to every pid in the tree (systemd's default KillMode=control-group) |
0.25 s |
Cause. The supervising process catches SIGINT, polls wait4(WNOHANG) for 0.25 s and goes back to a blocking wait without signalling the child. packages/reflex-base/src/reflex_base/utils/log.py:519 forwards only SIGTERM, and :520-526 does except KeyboardInterrupt: continue.
Under supervisord stopsignal=INT (default stopasgroup/killasgroup):
- the stop waits 10.2 s, then SIGKILLs only the supervisor pid;
- the inner reflex, the backend worker, bun and node become orphans that keep serving;
- the next
supervisorctl startfails 4× with "Frontend port: 3640 is already in use" and goes FATAL.
With stopasgroup=true it stops in 0.42 s, and with the default TERM config in 0.59 s.
Also affected:
- systemd with
KillMode=mixed/processandKillSignal=SIGINT; proc.send_signal(SIGINT);- docker
--init(tini) or running as PID 1 (simulated: hung 15 s); timeout --foreground -s INT.
GNU timeout -s INT signals the whole group, so it isn't affected. This contradicts the 0.10.0a1 changelog entry for #7328 ("stops its frontend on SIGTERM and SIGINT without a TTY") for --json.
Fix. Forward SIGINT to the child the same way SIGTERM is forwarded in log.py.
Repro: a3_upgrade/bin/json_matrix.sh a3fast a3 INT-pid:100000 (dir). Evidence: A3-07 in FINDINGS.md.
- Dominant language
- Python
- Stars
- 28.9k
- Forks
- 1.8k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 211
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from reflex-dev/reflex
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
reflex-dev/reflex#7561 · 1 comment ·
Maintainers usually reply within 1 day
-
npm: source-only hot reloads still reinstall packages because the rendered package.json has `devDependencies: {}` while the on-disk one has no key (residual of #7235)Possibly taken @harsh21234i claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
reflex-dev/reflex#7480 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
reflex-dev/reflex#7260 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#7148 · 1 comment ·
Maintainers usually reply within 1 day
-
ClientStateVar: a component that mounts while the value is non-default never re-renders on the push back to the defaultMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
reflex-dev/reflex#6823 · 1 comment ·
Maintainers usually reply within 1 day
All issues in reflex-dev/reflex
Similar issues
-
approved Good First Issue scope: docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
hiero-ledger/hiero-sdk-python#2730 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
wemake-services/wemake-django-template#3178 · 1 reaction ·
Maintainers usually reply within 1 day
-
md/asciidoc/csv: an explicit `encoding="utf-8"` keeps a leading BOM, the auto-detect path drops itOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
docling-project/docling#4846 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
neurostuff/NiMARE#1181 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pytest-dev/pytest#15180 ·
Maintainers usually reply within 1 day