scylladb / scylladb/python-rs-driver
Use Pyo3 extension traits for blocking methods to avoid deadlock with GIL
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6
- Forks
- 7
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 9
Description
While performing blocking operations on Mutex an extension method lock_py_attached() defined in extension trait should be used to avoid deadlocks with GIL and conflict with Python's GC.
Similar methods from respective extension traits should be used when using any other synchronization mechanisms from standard library.
We would like to replace all unsafe methods used in the project in addition to configuring clippy::disallowed_methods in config.toml to disallow blocking methods that don't acknowledge holding the GIL.
This way using potentially dangerous methods will require explicit allow lint.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by searching the repository for blocking synchronization methods and inspect config.toml for existing Clippy configuration. Compare each use with the relevant PyO3 extension trait, then confirm that all unsafe methods are replaced and dangerous alternatives are explicitly disallowed by the lint configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100