Redesign AsyncioWaker around caller-context-independent state transitions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- リファクタリング
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- backend, testing-qa
調査の方向性
Start with src/future/asyncio/waker.rs and the runtime attachment check in src/utils.rs, then run the subprocess regressions in python/tests/test_deadlocks.py. Agree on the state-machine design before implementation; done means the listed wake, callback, shutdown, finalization, and subprocess tests define correct behavior without public Python API changes.
索引モデルが issue の本文から書いたものです。
説明
Problem and proposed change
AsyncioWaker connects Rust future wakeups to an asyncio.Future. A mutex-protected slot records whether the coroutine is idle, was woken before parking, or is parked on a Python future.
A Rust future can wake:
- synchronously while Python is polling it; or
- later from a detached Tokio worker.
The standard Wake trait does not report which context called it. Current code therefore detects attachment at runtime. Parking also invokes Python event-loop methods while holding the slot mutex. These assumptions make lock ordering, shutdown, and interpreter finalization difficult to reason about.
Redesign the state machine so the mutex protects only short state transitions and ownership moves. Release the mutex before calling Python or destroying Python-owned values. Make wake_by_ref work without detecting caller attachment.
Agree on the design first, then implement it separately.
Context
Current slot states and parking path:
Current explicit wake methods and mixed-context Wake implementation:
Current runtime attachment check:
Existing subprocess regressions:
The same-thread re-entry report #212 was closed as not planned. This proposal is broader structural hardening, not an automatic reopening:
https://github.com/scylladb/python-rs-driver/issues/212
An unconditional Python attachment on every worker wake could hurt performance. Related investigation:
https://github.com/scylladb/python-rs-driver/issues/179
Acceptance criteria
- The slot guard protects only state transitions and ownership moves.
- Python calls and Python-owned-value destruction occur after unlocking.
wake_by_refdoes not need to detect caller attachment.- Wake before, during, and after parking remains correct.
- Tests cover synchronous self-wake and detached worker wake.
- Tests cover callback completion, close, cancel, and exception delivery.
- Task destruction and runtime shutdown behavior are defined.
- Interpreter-finalization behavior is defined if any fallback attaches.
- Potential hangs run in subprocesses with external watchdogs.
- Tests detect lost and duplicate wakeups.
- The worker fast path does not gain unconditional Python attachment without an explicit performance decision.
- No public Python API changes.
- 主要言語
- Rust
- スター
- 6
- フォーク
- 8
- 平均マージ
- 5日 9時間
- マージ済み PR(30日)
- 14
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scylladb/python-rs-driver のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
scylladb/python-rs-driver#224 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
scylladb/python-rs-driver#193 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 59/100
scylladb/python-rs-driver#235 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
scylladb/python-rs-driver#233 · コメント 4 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
scylladb/python-rs-driver#232 ·
メンテナーはふだん 1 日以内に返信
scylladb/python-rs-driver の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
storytold/photocraft#5710 ·
メンテナーはふだん 1 日以内に返信
-
Two tests fail on a Windows checkout: a CRLF parse in feature_walk_tests, an 8.3 TEMP path in libraries_tests対応中かも @CamWight が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bherbruck/solvecraft#1186 · コメント 1 件 ·
-
area: screenshot audit bug good first issue priority: P3 security severity: info type: correctness
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pierruno-labs/prowl#31 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
limitlessprojects/Go-Hybrid#50 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信