Skip to content

[codex] Fix RunDevServer SIGTERM orphaned GHCi#2616

Draft
mpscholten wants to merge 4 commits intocodex/pre-2607-masterfrom
codex/run-devserver-sigterm-fix
Draft

[codex] Fix RunDevServer SIGTERM orphaned GHCi#2616
mpscholten wants to merge 4 commits intocodex/pre-2607-masterfrom
codex/run-devserver-sigterm-fix

Conversation

@mpscholten
Copy link
Copy Markdown
Member

Summary

  • add a dedicated flake check that reproduces the RunDevServer SIGTERM orphaned-GHCi bug
  • install a process-local SIGTERM handler in RunDevServer
  • terminate the active GHCi child process group before exiting so the dev server does not leak an orphaned compiler process

Why

This keeps the new regression check in-tree while fixing the underlying bug, so the same CI path that fails on the regression-only branch should pass here.

User Impact

Stopping the dev server during the GHCi load/compile phase should no longer leave a stray ghci process behind holding :8000.

Root Cause

RunDevServer received SIGTERM, but the active GHCi child was started in its own process group. During the load phase, exiting the parent process was not enough to reliably kill that detached child.

Validation

  • bash -n integration-test/run-devserver-sigterm-check.sh
  • CI should exercise the new run-devserver-sigterm flake check and pass with the fix included

@mpscholten mpscholten force-pushed the codex/run-devserver-sigterm-fix branch from a11bd9a to bb09296 Compare April 5, 2026 20:21
@mpscholten mpscholten changed the base branch from master to codex/pre-2607-master April 5, 2026 20:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 5, 2026

Core Size & Compile Allocations Benchmark

Metric Baseline (master) This PR Change
Core size 11346666 bytes 11346659 bytes -0.0%
Compile allocations 27762080712 bytes 27762083712 bytes 0.0%

Core size within threshold
Compile allocations within threshold

HTTP Latency (GET /, 5000 reqs, 10 concurrent)

Metric Baseline (master) This PR Change
Mean 3.07ms 2.67ms -13.0%
p50 3.10ms 2.60ms
p99 4.80ms 5.50ms
Min 0.60ms 0.50ms
Max 15.60ms 13.80ms
Req/s 3242 3587

Improvement: Mean latency decreased -13.0%

Top 10 modules (this PR)

Module Size (bytes)
Web.Types.thr 547347
Web.FrontController.thr 428416
Web.Routes.thr 423680
Web.View.Threads.Show.thr 325442
Web.Controller.Threads.thr 322977
Web.Controller.Comments.thr 315692
Web.Controller.Users.thr 284459
Admin.FrontController.thr 276526
Admin.Types.thr 264263
build.Generated.User.thr 259919

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.

1 participant