get(), pop(), popitem(), and setdefault() are not thread-safe
- Dominant language
- Python
- Stars
- 72
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
#92 left a few important methods of MutableMapping prone to race conditions.
`get()` may or may not be thread-safe depending on the implementation details in collections.abc.
`pop()`, `popitem()` and `setdefault()` are definitely not thread-safe at the moment of writing.
Worth noting that this does not impact dask/distributed; the exclusion of their usage is enforced by the `distributed.spill.AsyncBufferProto` API contract.
Contributor guide
Research direction
No implementation files or tests are named. Start by locating the MutableMapping implementations for get(), pop(), popitem(), and setdefault(), then inspect how issue #92 addressed thread safety. Reproduce concurrent access where possible and add coverage showing the affected methods are safe without changing the distributed.AsyncBufferProto contract.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100