-
-
Notifications
You must be signed in to change notification settings - Fork 296
Closed
Description
Cache operations get and set are used inside a reentrant lock, but cache clear is called from parse_string outside that reentrant lock.
FifoCache set operation does this:
def set_(_, key, value):
cache[key] = value
while len(cache) > size:
# pop oldest element in cache by getting the first key
cache_pop(next(iter(cache)))That cache_pop(next(iter(cache)) is not thread safe.
Creating a bunch of threads parsing expressions in loop eventually raise a RuntimeError dictionary changed size during iteration
To reproduce it easier put another thread to call ParserElement.reset_cache() in loop
Metadata
Metadata
Assignees
Labels
No labels