This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Description
Once a Linearizer task acquires the lock, it does a 0-duration sleep to reset the call stack:
|
return self._clock.sleep(0) |
In the rare event that the task is cancelled while sleeping, the lock is not released and the Linearizer becomes stuck.
Can be reproduced by modifying the cancellation test slightly. Cancelling the 2nd task after 1st task releases the lock (instead of before) will make the test get stuck indefinitely:
with cm1:
pass
d2.cancel()
instead of
https://github.com/matrix-org/synapse/blob/release-v1.53/tests/util/test_linearizer.py#L159-L162