Fix potential threading issues when setting self.lock to None

This commit is contained in:
allegroai 2023-11-05 21:03:14 +02:00
parent e746b3e535
commit e7f4497e36

View File

@ -263,8 +263,8 @@ class TaskHandler(BufferingHandler):
# flush pending logs # flush pending logs
if not self._task_id: if not self._task_id:
return return
# avoid deadlocks just skip the lock, we are shutting down anyway # Never null the lock, it might be used by internal Python at some point
self.lock = None # self.lock = None
self._task_id = None self._task_id = None
# shut down the TaskHandler, from this point onwards. No events will be logged # shut down the TaskHandler, from this point onwards. No events will be logged