Skip to content

test: rows hold their blocking side on a dedicated thread - #759

Merged
Blind-Striker merged 3 commits into
masterfrom
test/753-no-pool-blocking
Nov 2, 2026
Merged

Blind-Striker merged 3 commits into
masterfrom
test/753-no-pool-blocking

Conversation

@Blind-Striker

@Blind-Striker Blind-Striker commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

What

Four test rows stop blocking a thread-pool thread on something only another pool item can release. One sentence goes into testing-style.md, by the maintainer's decision. Test code and that sentence only, with no product change.

Refs #753. Part of #758.

This isn't proven to be #753's cause

#753 showed up once in 18 runs under load here. A loop of only the classes involved was clean in 40 of 40, so neither loop can show a fix working. Thread-pool starvation from these rows is the leading hypothesis. These rows are fixed because the pattern is a defect by itself. #753 stays open until a window on CI passes with no hits.

What the sampling found

I sampled the test host's managed stacks every 5 s through 8 clean net472 runs, on 4 saturated cores (650 samples, 49 blocked pool stacks).

  • No sampled product frame waits. In all 49, a test frame is the one waiting, and product frames appear only below it, calling a test's own callback.
  • The limit: a 5-s interval sees only long blocks, so a brief product block could be missed.

The rows

Row Change
SendAsync_Should_Return_A_Queued_Rent_Before_The_First_Send_Is_Released (four data rows, which alone held all four pool threads in two samples) First send starts on a dedicated thread
Create_Should_Let_A_Timer_Callback_With_A_Registration_Race_Disposal Both barrier sides, on dedicated threads
CreateMessage_Should_Keep_Concurrent_Serializations_Separate (BlockingConverter) first starts on a dedicated thread
SendAsync_Should_Return_And_Clear_The_Rent_When_Refused_Behind_The_Gate The wait inside the payload callback runs on a dedicated thread. The hold on the receive path stays: it's what forces the refusal through the check behind the gate
CancelOnWorkerAsync_Should_Return_Without_Waiting_And_Complete_Only_After_Callbacks A comment only. The product runs this callback on the pool

Each moved row reaches its block with no yield first, on every data row and target. DedicatedThread.Run is the one helper, and its comment states that limit. No bound changed, and there are no retries.

The rule is stricter than the suite today

The sentence says what a test does. The remaining sites don't follow it yet: #758 lists them, and closes when each is fixed or has a recorded reason. That includes SendAsync_Should_Expire_A_Queued_Call_Without_Closing_The_Socket, whose fix crashes CA2025 on rc.3 (AD0001, a NullReferenceException in the analyzer). No suppression has been added, and it's retried at .NET 11 GA with #172.

Checks

  • Windows gate, static and tests parts, on this commit: 13,322 of 13,322.
  • Mutants, each on net10.0 and net472 unless noted:
Mutant Row Result
Queued rent not cleared Queued rent, four rows Killed, 4 of 4
No check behind the gate Refused behind the gate Killed
Idle writer not taken Concurrent serialization Killed (1 of 6 in its class, the concurrent row's job)
Callback ignores disposed Timer race, net472 only Killed
Dispose takes no lock Timer race, net472 only Survived, 0 of 20, and the same 0 of 20 with the row on Task.Run. So it isn't caused by this move; recorded on #758

The mutants for the first two rows ran on the commit before the last one, which doesn't touch them.

A row that blocks a pool thread on something only a pool item can release can starve the test
host under CPU load. Refs #753; this has not been shown to be that failure's cause.
…em can perform

The maintainer's decision. Refs #753.
@Blind-Striker
Blind-Striker added this pull request to the merge queue Nov 2, 2026
Merged via the queue into master with commit f9c4025 Nov 2, 2026
14 checks passed
@Blind-Striker
Blind-Striker deleted the test/753-no-pool-blocking branch November 2, 2026 19:44
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