Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork298
Closed
Description
Cache operationsget andset are used inside a reentrant lock, but cache clear is called fromparse_string outside that reentrant lock.
FifoCache set operation does this:
defset_(_,key,value):cache[key]=valuewhilelen(cache)>size:# pop oldest element in cache by getting the first keycache_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 RuntimeErrordictionary changed size during iteration
To reproduce it easier put another thread to callParserElement.reset_cache() in loop
Metadata
Metadata
Assignees
Labels
No labels