Skip to content

Fix racy assertion in inbound admission openssl_server_test - #8406

Open
Amaury Chamayou (achamayou) wants to merge 1 commit into
mainfrom
achamayou-probable-fortnight
Open

Amaury Chamayou (achamayou) wants to merge 1 commit into
mainfrom
achamayou-probable-fortnight

Conversation

@achamayou

Copy link
Copy Markdown
Member

Motivation

The Coverage workflow has been failing on main (e.g. run 35362158919, and the run before it) in openssl_server_test:

openssl_server_test.cpp:2348: FATAL ERROR: REQUIRE_FALSE( admission->saturated() ) is NOT correct!

in "Reads pause while the node-wide inbound budget is exhausted", added in #8117. This is a test race, not a transport bug.

Implementation summary

InboundAdmission::consumed() calls wake_all() synchronously when the budget drops back under the limit, so the server's loop thread resumes reading immediately. The client thread still has ~4 MiB buffered against a 64 KiB limit, so the server can read and re-saturate the budget between consumed() returning and the test thread evaluating REQUIRE_FALSE(admission->saturated()).

The check is dropped and the comment explains why an immediate check is not valid. Resumption is already proven by the drain loop directly after it, which keeps releasing and requires received == to_send.

Reproduced locally by pinning the test to a single CPU so the loop thread preempts the test thread: the original fails 33/40 runs, all at line 2348; with this change it passes 40/40 under the same conditions, and the full openssl_server_test binary passes.

Note: like several other tests in this file, a failed REQUIRE here unwinds past a joinable std::thread, which is why the failure surfaced as SIGABRT ("terminate called without an active exception") and skipped the remaining test case. That pattern is file-wide and left unchanged.

Safety and compatibility

Test-only change; no runtime impact.

InboundAdmission::consumed() wakes the transport synchronously, so the loop
thread can read and re-saturate the 64KiB budget before the test thread
evaluates REQUIRE_FALSE(admission->saturated()). Drop the check; resumption
is already proven by the drain loop that follows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 16:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The test-only change removes the race while preserving validation of eventual data delivery.

Pull request overview

Fixes a scheduler-racy assertion in the inbound admission OpenSSL test without affecting runtime behavior.

Changes:

  • Removes the unreliable immediate saturation check.
  • Retains drain-loop validation of resumed reads and complete delivery.
File summaries
File Description
src/tls/test/openssl_server_test.cpp Removes the racy assertion and documents the synchronization behavior.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants