Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Concurrency issue on Cache when packrat is enabled. #604

Closed
Assignees
ptmcg
@CarlosDescalziIM

Description

@CarlosDescalziIM

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp