dispatch signals may be skipped
|Reported by:||zac256@…||Owned by:||nobody|
|Severity:||Keywords:||bug, dispatcher, dispatch, signal, garbage collection|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Because in dispatch.dispatcher.py _live_receivers does not acquire the lock that _remove_receiver does it is possible for the iteration over self.receivers to skip items. This is possible even without threading because _remove_receiver can be called as a result of garbage collection.
The fix is simple: acquire self.lock around the iteration over self.receivers in _live_receivers