Repository navigation
Commit 4cbebec
authored
test: tolerate curl send errors when the listener closes during shutdown (#2724)
`tests/shutdown_test.sh` (added in
#2645) failed on
#2721 with `FAIL: PHP request
failed with curl exit code 55`
([job](https://github.com/php/frankenphp/actions/runs/38898098911/job/116963348236)).
The failure lines up with the last server log line, `servers shutting
down; grace period initiated`, logged when Caddy closes its listeners
after `shutdown_delay`.
Closing a listening socket resets the connections still waiting in its
accept queue. Depending on when the reset reaches curl, the request
fails with 52 (empty reply), 56 (receive error) or 55 (send error). The
test already treated 52 and 56 as `closing`, but not 55, which needs the
reset to arrive between `connect()` and the first `send()`.
Stressing the shutdown in a Linux container (40 restarts, 24 concurrent
clients, ~36k requests against `main`) produced 29 × 52 and 30 × 56 at
listener close and no other errors, so 55 is the same race with a
narrower window. The server can't prevent it, so the test now accepts 55
too. The checks that matter are unchanged: requests served during
`shutdown_delay`, in-flight requests drained, PHP shut down last. The
patched script passed 10/10 runs in the same container.1 parent 8667a12 commit 4cbebec
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments