bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765)#21765
Conversation
vsajip
left a comment
There was a problem hiding this comment.
Does the test fail if you leave setTarget() unchanged?
|
Yes, are you not seeing that? ======================================================================
|
I didn't test it myself - just wanted to confirm that was the case. Thanks! I'll mark for automerge and approve as soon as the remaining buildbots are done. |
|
Thanks @iritkatriel for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
|
Thanks @iritkatriel for the PR, and @vsajip for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
…emoryHandler (pythonGH-21765) (cherry picked from commit 2353d77) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
|
GH-21897 is a backport of this pull request to the 3.9 branch. |
|
GH-21898 is a backport of this pull request to the 3.8 branch. |
…emoryHandler (pythonGH-21765) (cherry picked from commit 2353d77) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
…yHandler
The logging.handlers.MemoryHandler.setTarget() method does not acquire the lock, so it can change the target while flush is processing the buffer.
https://bugs.python.org/issue41503