Fix net48 deadlock test hang: use dedicated thread instead of signal-based synchronization - #157
Merged
jpablo2002 merged 1 commit intoJul 29, 2026
Conversation
…k test Use a dedicated thread for Cancel() with a brief sleep instead of MRES dual-registration, which hangs on .NET Framework 4.8 CI agents due to callback-ordering differences (LIFO vs FIFO) and thread-pool pressure.
leti367
approved these changes
Jul 29, 2026
klvnraju
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The deadlock regression tests hang on .NET Framework 4.8 in ADO CI. Two signal-based approaches failed:
The fundamental issue is that .NET has no API to observe when a thread is blocked on a specific lock. On net48, any monitoring callback registered on the same CancellationToken fires before the SSH callback starts, so signal-based coordination is impossible without modifying production code.
Fix: Replace with
new Thread(() => Cancel())+Thread.Sleep(200). The dedicated thread eliminates pool dependency, and the 200ms wait provides a safety margin for the callback to reach lock contention.