Redesign AsyncioWaker around caller-context-independent state transitions
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Refactorización
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- backend, testing-qa
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 6
- Forks
- 8
- Merge medio
- 5 d 9 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de scylladb/python-rs-driver
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
scylladb/python-rs-driver#224 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
scylladb/python-rs-driver#193 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 59/100
scylladb/python-rs-driver#235 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
scylladb/python-rs-driver#233 · 4 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Add python 3.15 supportAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
scylladb/python-rs-driver#232 ·
Los mantenedores suelen responder en 1 día
Todos los issues de scylladb/python-rs-driver
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
V1 manifest lists written by Java lose added/existing/deleted file countsPosiblemente ocupada @kacper-li-airspace-intelligence la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/iceberg-rust#3445 ·
Los mantenedores suelen responder en 4 días
-
Slack integration: links on self-hosted domains never unfurl (parseCapShareUrl only accepts cap.so / cap.link)Posiblemente ocupada @mangeshraut712 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
CapSoftware/Cap#2546 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
sync: small cleanups after #69Abiertoarea::tern-sync kind::cleanup triage::ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día