Message233650
The way the fnmatch module uses its regex cache is not threadsafe. When multiple threads use the module in parallel, a race condition between retrieving a - presumed present - item from the cache and clearing the cache (because the maximum size has been reached) can lead to KeyError being raised.
The attached script demonstrates the problem. Running it will (eventually) yield errors like the following.
Exception in thread Thread-10:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "fnmatch_thread.py", line 12, in run
fnmatch.fnmatchcase(name, pat)
File "/home/marc/.venv/modern/lib/python2.7/fnmatch.py", line 79, in fnmatchcase
return _cache[pat].match(name) is not None
KeyError: 'lYwrOCJtLU' |
|
Date |
User |
Action |
Args |
2015-01-08 13:02:17 | mschmitzer | set | recipients:
+ mschmitzer |
2015-01-08 13:02:17 | mschmitzer | set | messageid: <1420722137.58.0.63717437035.issue23191@psf.upfronthosting.co.za> |
2015-01-08 13:02:17 | mschmitzer | link | issue23191 messages |
2015-01-08 13:02:17 | mschmitzer | create | |
|