mirror of
https://github.com/beetbox/beets.git
synced 2026-02-27 09:41:51 +01:00
never invalidate a queue with None
I saw this *extremely* intermittently (and wasn't able to reproduce it at all), but I think there was a race when invalidating an output queue in the abort() method of PipelineThread. It was possible for a thread's input queue to be invalidated (with val=None) while abort_flag was False (and abort_lock was not held). This would cause coroutines to see a None value when the pipeline was shutting down. Always poisoning a queue when it's invalidated should solve this by making the thread break before sending the value to the coroutine.
This commit is contained in:
parent
b44195853c
commit
fabaf41ecf
1 changed files with 2 additions and 2 deletions
|
|
@ -157,9 +157,9 @@ class PipelineThread(Thread):
|
|||
|
||||
# Ensure that we are not blocking on a queue read or write.
|
||||
if hasattr(self, 'in_queue'):
|
||||
_invalidate_queue(self.in_queue)
|
||||
_invalidate_queue(self.in_queue, POISON)
|
||||
if hasattr(self, 'out_queue'):
|
||||
_invalidate_queue(self.out_queue)
|
||||
_invalidate_queue(self.out_queue, POISON)
|
||||
|
||||
def abort_all(self, exc_info):
|
||||
"""Abort all other threads in the system for an exception.
|
||||
|
|
|
|||
Loading…
Reference in a new issue