Having updated to Rx.NET 3.0.0 I am seeing a deadlock occur in LocalScheduler due to the use of two locks, which are taken in different orders depending on the code path.
I am seeing one thead stuck in SystemClockChanged, having taken a lock on _gate and now waiting for a lock on s_gate. Another thread has entered ScheduleShortTermWork via EvaluateLongTermQueue, which has a lock on _gate, and is now waiting for a lock on s_gate.
Having reversed the order of locks taken in SystemClockChanged and rebuilt System.Reactive.Core locally, I no longer see this issue.
We are using version 3.1.1 and we are experiencing the same deadlock as described by tcberry.
See the attached snapshot:
I've just discovered this issue myself (after going through the v3 package rename pain) and was dismayed to find this 9 month old bug report and a 4.0 milestone. I'm not sure how more people aren't screaming about this. Maybe they can't figure out why their applications are freezing or randomly stopping working.
Any chance this can be raised in priority for a 3.1.2 release? The fix is tiny as shown by @tcberry.
The PR for this issue has been merged; we'll look to include it in the next release.
Most helpful comment
I've just discovered this issue myself (after going through the v3 package rename pain) and was dismayed to find this 9 month old bug report and a 4.0 milestone. I'm not sure how more people aren't screaming about this. Maybe they can't figure out why their applications are freezing or randomly stopping working.
Any chance this can be raised in priority for a 3.1.2 release? The fix is tiny as shown by @tcberry.