From 28668f62f8e389365aa335d2ef31c86b3f8f3e28 Mon Sep 17 00:00:00 2001 From: sideshowbarker Date: Tue, 8 Sep 2026 22:14:27 +0900 Subject: [PATCH] =?UTF-8?q?Raise=20the=20HTTP=20server=E2=80=99s=20listen?= =?UTF-8?q?=20backlog=20to=20128?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: In a macOS 27 environment, Speedometer 2/3 wedged partway through, with every browser process idle, after 45/48 and 6/58 tests. StyleBenchConservative never reached its first test — so three of the ten suites couldn’t be run in that environment at all. Cause: The benchmark server is a single-threaded HTTPServer with the default listen backlog of 5, and it accepts connections one at a time. Speedometer burst opens 7–8 connections in 1ms (TodoMVC-WebComponents fetches 20 files in two such waves). So the queue overflows at the edge. Linux then queues the overflow, and the client retransmits 1s later; but macOS aborts it with a reset — which RequestServer reports as curl error 56, and LibWeb as a failed script load. Which fetch loses is a race: a lost speculative preload is harmless, since the script element fetches again on its own — but a lost script fetch leaves the app under test un- initialized. A test step throws, the runner’s promise never resolves, and nothing’s left pending — hence the idle browser. One Speedometer 2 run on this server had 14 fetches reset yet still completed, others never got Flight-TodoMVC up at all, and StyleBenchConservative lost its own runner scripts, tests.js and style-bench.js, and never started. Fix: Give the server a backlog of 128, which is the most macOS allows and more than any suite opens at once. With that one change, and none to the browser, Speedometer 2/3, and StyleBenchConservative all run to completion in the tested environment — without a single failed load. --- run.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index d95904e..bf3ab3a 100755 --- a/run.py +++ b/run.py @@ -112,8 +112,12 @@ def log_message(self, format, *args): pass +class BenchmarkHTTPServer(HTTPServer): + request_queue_size = 128 + + def start_http_server(): - server = HTTPServer(('localhost', 0), BenchmarkHTTPRequestHandler) + server = BenchmarkHTTPServer(('localhost', 0), BenchmarkHTTPRequestHandler) server.running_ladybird_process = None server.last_progress_time = time.monotonic() server.current_test = None