http11 test suite is unreliable under load
Closed / Fixed3764f4e81f1483ab554c6d60f8483887bde28221Created 1 year agoUpdated 21 days ago
Descriptionmarkdown2025-09-05 11:34:09
The http11 test suite appears to be unreliable on a loaded system. We're occasionally seeing failures that look like this:
Only running test files that match: http11.test
Tests began at Thu Aug 21 09:30:07 UTC 2025
http11.test
==== Test with ThreadLevel 0 ====
==== Test with ThreadLevel 1 ====
==== http11-1.8.1 normal, 1.1 and keepalive, server close FAILED
==== Contents of test case:
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?close=1 -protocol 1.1 -keepalive 1 -timeout 10000]
http::wait $tok
list [http::status $tok] [http::code $tok] [check_crc $tok] [meta $tok connection] [meta $tok transfer-encoding]
---- Result was:
eof {} {crc32 mismatch: ne 0} {} {}
---- Result should have been (exact matching):
ok {HTTP/1.1 200 OK} ok close {}
==== http11-1.8.1 FAILED
Or:
==== http11-2.10.1.1 -channel,deflate,keepalive,msdeflate FAILED
==== Contents of test case:
set tok [http::geturl http://localhost:$httpd_port/testdoc.html?msdeflate=1 -timeout 5000 -channel $chan -keepalive 1 -headers {accept-encoding deflate}]
http::wait $tok
seek $chan 0
set data [read $chan]
list [http::status $tok] [http::code $tok] [check_crc $tok $data] [meta $tok connection] [meta $tok content-encoding] [meta $tok transfer-encoding] [expr {[file size testdoc.html]-[file size testfile.tmp]}]
---- Result was:
eof {} {crc32 mismatch: ne 0} {} {} {} 130034
---- Result should have been (exact matching):
ok {HTTP/1.1 200 OK} ok {} deflate chunked 0
==== http11-2.10.1.1 FAILED
Or:
==== http11-2.12.1 -channel,negotiate,keepalive FAILED
==== Contents of test case:
set tok [http::geturl http://localhost:$httpd_port/testdoc.html -timeout 5000 -channel $chan -keepalive 1]
http::wait $tok
seek $chan 0
set data [read $chan]
list [http::status $tok] [http::code $tok] [check_crc $tok $data] [meta $tok connection] [meta $tok content-encoding] [meta $tok transfer-encoding] [m
eta $tok x-requested-encodings] [expr {[file size testdoc.html]-[file size testfile.tmp]}]
---- Result was:
eof {} {crc32 mismatch: ne 0} {} {} {} {} 130034
---- Result should have been (exact matching):
ok {HTTP/1.1 200 OK} ok {} gzip chunked gzip,deflate 0
==== http11-2.12.1 FAILED
Referenced by4
655b9df308Fix [05b158ed56] and [3764f4e81f]: http::OpenSocket opens a new connection if the persistent socket it was going to reuse has been closed in the meantime check-in2026-11-10 16:11:2098a1b78011Fix [05b158ed56] and [3764f4e81f]: http::OpenSocket opens a new connection if the persistent socket it was going to reuse has been closed in the meantime check-in2026-11-10 16:08:24a07f327187Ticket [05b158ed56] http::geturl -keepalive intermittent socketWrState errors status still Open with 4 other changes ticket2026-10-16 21:36:1100a815eb5eFix [05b158ed56] and [3764f4e81f]: http::OpenSocket opens a new connection if the persistent socket it was going to reuse has been closed in the meantime (e.g. by CheckEof), instead of failing with "can't read socketWrState(...)". An empty line left after a chunked response on a persistent socket is not taken as the status line, so that the request is replayed if eof follows. check-in2026-10-16 21:34:52
rossburton Ticket [3764f4e81f]: 3 changes
[History diff]2025-09-05 11:42:45
rossburton Ticket [3764f4e81f]: 3 changes
[History diff]2025-09-05 11:49:58
serhiy.storchakawiki2026-10-16 21:36:11
The failures happen when a new test server gets the same port as an earlier one, so the client reuses a dead persistent socket, and http.tcl does not replay the request: an empty line left after a chunked -channel response is taken as the status line (8.6 too), and in 9.x http::CheckEof can close a socket that a queued request is about to use ("can't read socketWrState(...)", [05b158ed56]). Proposed fix in branch http-keepalive-reuse-closed, test http11-5.1.
jan.nijtmanswiki2026-11-11 22:29:46
Merged to [trunk] and core-9-0-branch
Many thanks!
Log in (anonymous is fine) to add a comment.