[CSHARP-3815] Make SemaphoreSlimSignalable.Signal end SemaphoreSlimSignalable.WaitSignaledAsync immediately Created: 24/Aug/21  Updated: 15/Nov/21  Resolved: 06/Sep/21

Status: Closed
Project: C# Driver
Component/s: Internal
Affects Version/s: None
Fix Version/s: 2.14.0

Type: Improvement Priority: Unknown
Reporter: Boris Dogadov Assignee: Boris Dogadov
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-3800 Fix flaky RetryableReadsProseTests.Po... Closed

 Description   

As an optimization for preventing WaitSignaledAsync task execution to continue on Signal thread, cancelation was scheduled on another thread with 0ms timeout. This introduced a race condition where WaitSignaledAsync can succeed despite being signaled.

Eliminate this race condition and prevent WaitSignaledAsync to be resumed on Signal thread.



 Comments   
Comment by Githook User [ 06/Sep/21 ]

Author:

{'name': 'Boris', 'email': 'boris.dogadov@mongodb.com', 'username': 'BorisDog'}

Message: CSHARP-3815: Make SemaphoreSlimSignalable.Signal end SemaphoreSlimSignalable.WaitSignaledAsync immediately
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/b961b81cb7dc1ffe7262c55a227afad0aab5a994

Generated at Wed Feb 07 21:46:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.