scylladb / scylladb/python-rs-driver

Use Pyo3 extension traits for blocking methods to avoid deadlock with GIL

Open
#64 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.