This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Weird locking in logging config system
Type: Stage:
Components: Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: aronacher, vinay.sajip
Priority: normal Keywords: patch

Created on 2010-09-25 14:17 by aronacher, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
logging-config-threadsafety.patch aronacher, 2010-09-25 14:17
Messages (3)
msg117370 - (view) Author: Armin Ronacher (aronacher) * (Python committer) Date: 2010-09-25 14:17
Another case of improper locking in logging.  The stopListening() method of the logging config acquires the logging lock, but it doesn't do it early enough.  In order for this function to be thread safe it would have to lock before the if.

Currently that lock used is useless because it locks assigning to a single attribute assignment and a global assignment that is never checked to existence besides the stopListening() function.

The attached patch proposes moving the lock before the if to make it threadsafe, but in all fairness sake that method is probably never executed from more than one thread.
msg117383 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-09-25 17:49
Fix checked into py3k and release27-maint, r85013.

Thanks!
msg117479 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2010-09-27 21:51
Fix checked into release31-maint (r85046).
History
Date User Action Args
2022-04-11 14:57:06adminsetgithub: 54156
2010-09-27 21:51:54vinay.sajipsetmessages: + msg117479
2010-09-25 17:49:12vinay.sajipsetstatus: open -> closed
resolution: fixed
messages: + msg117383
2010-09-25 14:17:38aronachercreate