[New-bugs-announce] [issue9947] Weird locking in logging config system

Armin Ronacher report at bugs.python.org
Sat Sep 25 16:17:40 CEST 2010


New submission from Armin Ronacher <armin.ronacher at active-4.com>:

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.

----------
assignee: vinay.sajip
files: logging-config-threadsafety.patch
keywords: patch
messages: 117370
nosy: aronacher, vinay.sajip
priority: normal
severity: normal
status: open
title: Weird locking in logging config system
versions: Python 2.7
Added file: http://bugs.python.org/file19007/logging-config-threadsafety.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9947>
_______________________________________


More information about the New-bugs-announce mailing list