Skip to content

test: end the references without waiting for their requests - #3

Merged
sorge-it merged 1 commit into
mainfrom
test/bounded-reference-stop
Nov 21, 2026
Merged

sorge-it merged 1 commit into
mainfrom
test/bounded-reference-stop

Conversation

@sorge-it

Copy link
Copy Markdown
Owner

What

  • FrankenPhpReference ends each FrankenPHP with SIGKILL, when it makes room for another one and
    when it stops.
  • GoReference::lingers() reads for at most 5 seconds.

Why

The macOS job of #2, a docs-only change, hung in the GoNetHttp suite until the job's timeout of
15 minutes; on main the suite takes 2 minutes. FrankenPHP processes were still running at the end.

Measured locally on macOS, with FrankenPHP 1.13.6: on SIGTERM, FrankenPHP waits without end for a
script that still reads the body of a connection that the client keeps open. proc_close() waits
with it. grace_period 1s in the Caddyfile does not end the wait; SIGKILL does:

stop() with a request in progress before after
client closed 0.04 s 0.02 s
client open no end within 40 s 0.02 s

The hang of #2 did not happen again in four local runs of the suite, so this change bounds the
wait that fits it, without proof that it was the one. In lingers(), a read that times out returns
'', not false, so a Go that never closed would have held the suite too.

Tests

composer test in Docker on Debian (PHP 8.4) and Alpine (PHP 8.5, locked and newest), on arm64 and
amd64: 6 of 6 green, 627 tests each. Coverage 100.0 %. The Connection, GoNetHttp and
FrankenPhp suites on macOS: 278 tests green.

On SIGTERM, FrankenPHP waits without end for a script that still reads
the body of an open connection, and proc_close() with it. The macOS job
of PR 2 hung in GoNetHttp with FrankenPHP processes left, which fits.
The references now end with SIGKILL; lingers() reads at most 5 seconds.
@sorge-it
sorge-it marked this pull request as ready for review November 21, 2026 15:09
@sorge-it
sorge-it merged commit cae747d into main Nov 21, 2026
12 of 13 checks passed
@sorge-it
sorge-it deleted the test/bounded-reference-stop branch November 21, 2026 15:10
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