Content-Length: 288209 | pFad | https://github.com/python/cpython/issues/92530

BE Issues when Condition.notify() is interrupted · Issue #92530 · python/cpython · GitHub
Skip to content

Issues when Condition.notify() is interrupted #92530

@serhiy-storchaka

Description

@serhiy-storchaka

If threading.Condition.notify() is interrupted just after it releases the waiter lock, but before remove it from the queue, the following calls of notify() will fail with RuntimeError: cannot release un-acquired lock. It can block the waiter threads if they do not use timeout.

cpython/Lib/threading.py

Lines 375 to 380 in 5bc2390

for waiter in waiters_to_notify:
waiter.release()
try:
all_waiters.remove(waiter)
except ValueError:
pass

The simplest solution would be to silence a RuntimeError in waiter.release(). There may be similar issues in other parts of the code.

Metadata

Metadata

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/92530

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy