Skip to content

test(benchmarks): observe stalled sockets outside the IO worker - #74

Merged
nick2781 merged 2 commits into
mainfrom
test/tcp-stall-observer
Nov 5, 2026
Merged

nick2781 merged 2 commits into
mainfrom
test/tcp-stall-observer

Conversation

@nick2781

@nick2781 nick2781 commented Nov 5, 2026

Copy link
Copy Markdown
Member

The native Asio connection benchmark previously collected socket state only on its IO worker. A stalled worker and a socket with no consumable bytes could therefore look similar. Add a default-off Unix controller-thread observer that records non-consuming poll/FIONREAD/MSG_PEEK results, bounded socket histories, strand probes and validated Apple TCP information.

Pin descriptors with generation-checked leases and retire them before cancellation; cap storage at 16 sessions and eight samples per session. Include bracketed steady/wall-clock anchors and cancellation timestamps so later local sequence/ACK captures can be aligned without assuming clocks are interchangeable. Reject the option on Windows and keep library transport, workload deadlines and default benchmark behavior unchanged.

Validation at fe83d005b5c318da34938e06a1384f9d4f84a3f9: six observer cases / 45 assertions, existing kernel-sample checks, native self-test, a controlled one-connection timeout/cleanup integration check, and clang-format 18 passed. English and Chinese benchmark instructions are included.

Three bounded local 5,000-connection trials established every connection and ended with 1, 3 and 0 stalled peer pairs. The retained pre-cancellation observations showed no consumable receive-socket bytes; that narrows investigation but does not establish a transport defect, root cause, fix or deployment capacity. Raw logs and measurements remain local. Follow-up sequence/ACK investigation is tracked by #61; this diagnostic PR does not resolve that issue.

@nick2781
nick2781 added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 72281e0 Nov 5, 2026
10 checks passed
@nick2781
nick2781 deleted the test/tcp-stall-observer branch November 5, 2026 09: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