Skip to content

Fix Chromium supervisor stop signaling#259

Merged
rgarcia merged 1 commit into
mainfrom
fix/chromium-supervisor-stop-loop
May 28, 2026
Merged

Fix Chromium supervisor stop signaling#259
rgarcia merged 1 commit into
mainfrom
fix/chromium-supervisor-stop-loop

Conversation

@rgarcia
Copy link
Copy Markdown
Contributor

@rgarcia rgarcia commented May 28, 2026

Summary

  • Signal the full Chromium process group when supervisord stops Chromium in both headful and headless images.
  • Change stopwaitsecs from 0 to 1 so supervisord has a short window to observe SIGCHLD after the initial SIGKILL instead of immediately entering its final-kill loop.

Why

We observed supervisorctl stop chromium producing thousands of repeated killing 'chromium' (...) with SIGKILL log lines before reporting stopped.

Supervisor's STOPPING transition loop explains this behavior: when the process is STOPPING and delay - now <= 0, it logs the final SIGKILL warning and calls kill(SIGKILL) again. With stopwaitsecs=0, that deadline is expired immediately, so supervisord can repeat this until SIGCHLD processing catches up:

stopasgroup=true / killasgroup=true also ensures Chromium renderer, utility, zygote, and browser descendants in the supervised process group receive the stop signal, rather than only signaling the direct supervised runuser process.

Test plan

  • Rebuilt headful image locally: DOCKER_BUILDKIT=1 docker build -f images/chromium-headful/Dockerfile -t kernel-headful-test .
  • Ran 40 /process/exec stop/start iterations against the rebuilt headful container: max stop latency was 181ms and no repeated killing 'chromium' ... SIGKILL lines appeared.
  • Opened 80 Chromium pages via Playwright CDP, then stopped Chromium through /process/exec: stop completed in 229ms and live Chromium descendants were gone afterward.

Made with Cursor


Note

Low Risk
Container runtime/supervisor tuning only; no app auth, data, or API surface changes, with minimal behavioral impact beyond cleaner Chromium shutdown.

Overview
Updates supervisord’s Chromium program config in headful and headless images so stops target the whole process group and don’t spin on repeated SIGKILLs.

Both chromium.conf files now set stopasgroup=true and killasgroup=true, so stop/kill signals reach Chromium’s child processes (not only the launcher). stopwaitsecs changes from 0 to 1, giving supervisord a brief window after the initial KILL before its STOPPING loop re-issues SIGKILL—addressing noisy supervisorctl stop chromium logs and long stop times.

Reviewed by Cursor Bugbot for commit 4cb2357. Bugbot is set up for automated code reviews on this repo. Configure here.

Give supervisord a short SIGCHLD window and signal the Chromium process group so stop does not tight-loop SIGKILL or leave descendants behind.

Co-authored-by: Cursor <cursoragent@cursor.com>
@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: This PR modifies Chromium supervisor configuration in Docker images, not the kernel API endpoints or Temporal workflows specified in the filter.

To monitor this PR anyway, reply with @firetiger monitor this.

@rgarcia rgarcia requested a review from hiroTamada May 28, 2026 21:26
@rgarcia rgarcia merged commit 7b802e4 into main May 28, 2026
9 checks passed
@rgarcia rgarcia deleted the fix/chromium-supervisor-stop-loop branch May 28, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants