Skip to content

Raise the HTTP server’s listen backlog to 128 - #1

Open
sideshowbarker wants to merge 1 commit into
LadybirdBrowser:masterfrom
sideshowbarker:listen-backlog
Open

sideshowbarker wants to merge 1 commit into
LadybirdBrowser:masterfrom
sideshowbarker:listen-backlog

Conversation

@sideshowbarker

Copy link
Copy Markdown
Member

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 uninitialized. 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.

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.
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2ad06644-0f81-4de9-beb3-9077bcf8e97e

📥 Commits

Reviewing files that changed from the base of the PR and between f57e0f6 and 28668f6.

📒 Files selected for processing (1)
  • run.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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