Make transaction early-flush writer test deterministic#8872
Conversation
Observe the flush request on the dedicated processing thread instead of polling api.Sent, which raced a starved thread pool.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8872) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (70ms) : 67, 73
master - mean (71ms) : 68, 73
section Bailout
This PR (8872) - mean (76ms) : 72, 80
master - mean (74ms) : 73, 75
section CallTarget+Inlining+NGEN
This PR (8872) - mean (1,083ms) : 1045, 1122
master - mean (1,089ms) : 1039, 1138
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (109ms) : 106, 112
master - mean (110ms) : 105, 115
section Bailout
This PR (8872) - mean (115ms) : 109, 121
master - mean (110ms) : 108, 112
section CallTarget+Inlining+NGEN
This PR (8872) - mean (778ms) : 760, 797
master - mean (783ms) : 759, 806
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (96ms) : 94, 99
master - mean (98ms) : 93, 103
section Bailout
This PR (8872) - mean (100ms) : 94, 106
master - mean (101ms) : 96, 106
section CallTarget+Inlining+NGEN
This PR (8872) - mean (938ms) : 903, 974
master - mean (936ms) : 900, 973
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (97ms) : 92, 102
master - mean (95ms) : 92, 97
section Bailout
This PR (8872) - mean (96ms) : 95, 98
master - mean (96ms) : 94, 98
section CallTarget+Inlining+NGEN
This PR (8872) - mean (812ms) : 778, 845
master - mean (816ms) : 773, 860
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (202ms) : 199, 206
master - mean (203ms) : 197, 209
section Bailout
This PR (8872) - mean (203ms) : 200, 206
master - mean (207ms) : 203, 211
section CallTarget+Inlining+NGEN
This PR (8872) - mean (1,217ms) : 1170, 1264
master - mean (1,213ms) : 1168, 1258
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (290ms) : 283, 297
master - mean (289ms) : 281, 298
section Bailout
This PR (8872) - mean (291ms) : 284, 298
master - mean (291ms) : 286, 295
section CallTarget+Inlining+NGEN
This PR (8872) - mean (972ms) : 949, 994
master - mean (972ms) : 954, 991
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (285ms) : 279, 292
master - mean (282ms) : 275, 288
section Bailout
This PR (8872) - mean (283ms) : 277, 290
master - mean (279ms) : 273, 284
section CallTarget+Inlining+NGEN
This PR (8872) - mean (1,174ms) : 1128, 1220
master - mean (1,164ms) : 1125, 1203
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8872) - mean (282ms) : 274, 290
master - mean (277ms) : 270, 283
section Bailout
This PR (8872) - mean (281ms) : 273, 289
master - mean (274ms) : 266, 282
section CallTarget+Inlining+NGEN
This PR (8872) - mean (1,049ms) : 1012, 1086
master - mean (1,042ms) : 998, 1086
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2026-07-07 16:55:12 Comparing candidate commit 6ed5203 in PR branch Found 0 performance improvements and 2 performance regressions! Performance is the same for 70 metrics, 0 unstable metrics, 61 known flaky benchmarks, 65 flaky benchmarks without significant changes.
|
Summary of changes
Assert that crossing the transaction byte threshold requests a flush, instead of polling
api.Sent. Adds aninternal event Action? FlushRequestedonDataStreamsWriter(test-only, like the existingFlushComplete).Reason for change
WhenSupported_TriggersEarlyFlush_WhenTransactionsExceedThresholdflaked in CI (Expected api.Sent not to be empty, ~41s vs a 30s budget). With the timer disabled, the test relied solely on the flush pipeline's thread-pool, which stalls under a saturated pool.Implementation details
The test now awaits
FlushRequestedinstead of the pool-driven send.Test coverage
Test now asserts the event/action is triggered instead of waiting for the flush to occur
Other details
#incident-57303