fix(operators): serialize timeout terminal delivery#84
Conversation
glennawatson
left a comment
There was a problem hiding this comment.
Verified against #68. The shared Lock now serializes value delivery with the timeout: OnNext/OnError/OnCompleted/EmitTimeout all check-and-set _done and forward under the gate, so a timeout OnError can no longer enter the observer concurrently with an in-flight OnNext. Dispose stays outside the lock. System.Threading.Lock is reentrant, so synchronous re-entrancy won't deadlock. Threaded test confirms it. LGTM.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
+ Coverage 90.37% 90.39% +0.02%
==========================================
Files 649 649
Lines 20228 20251 +23
Branches 2416 2419 +3
==========================================
+ Hits 18281 18306 +25
+ Misses 1564 1563 -1
+ Partials 383 382 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |



What kind of change does this PR introduce?
Bug fix for timeout operator concurrency.
What is the new behavior?
Timeout terminal delivery is serialized with source notifications so a timeout
OnErrorcannot enter an observer concurrently with an in-flightOnNext.Fixes #68.
What is the current behavior?
A timeout timer can emit
OnErrorwhile the upstreamOnNextpath is still inside the downstream observer, allowing observer calls to overlap.Checklist
Additional information
Validation:
dotnet build "tests/ReactiveUI.Primitives.Tests/ReactiveUI.Primitives.Tests.csproj" -f net10.0 --no-restore -v minimaldotnet test "tests/ReactiveUI.Primitives.Tests/ReactiveUI.Primitives.Tests.csproj" -f net10.0 --no-build -- --treenode-filter "/*/*/ExpireCoordinatorTests/*" --output Detailedmcp__mtpunittestmcp.get_solution_coveragewas run, but no Cobertura coverage data was present under the solution directory.A full multi-target test command was attempted first but exceeded the local timeout while the repository was under parallel issue validation load.