ProgressDispatcher: a slow progress subscriber blocks subscribe() and delivery for other tokens
Los mantenedores suelen responder en 3 días
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start in crates/rmcp/src/handler/client/progress.rs and review PR #1310, which contains the proposed fix and tests. Run test_slow_subscriber_does_not_block_other_tokens, test_resubscribing_a_dropped_token_keeps_the_new_subscriber, test_dropping_a_replaced_subscriber_keeps_its_replacement, and dropping_a_subscriber_unregisters_it_without_a_runtime; done means all pass without changing the public API.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
ProgressDispatcher::handle_notification (crates/rmcp/src/handler/client/progress.rs) holds the read guard of its tokio::sync::RwLock across sender.send(notification).await. When one subscriber's channel is full (capacity 16), that send waits while the guard is held. Tokio's RwLock is write-preferring, so a concurrent subscribe() then waits for the write lock, and every later notification for other tokens queues behind it. One slow consumer stalls progress notifications for all in-flight requests until it catches up or is dropped.
Two smaller problems in the same file:
ProgressSubscriber::dropremoves its entry withtokio::spawn, so dropping a subscriber outside a Tokio runtime panics (there is no reactor running).- Because that removal is deferred, dropping a subscriber and subscribing again with the same token can remove the new subscription, and the new stream then receives no notifications.
To Reproduce
PR #1310 adds tests for all three: test_slow_subscriber_does_not_block_other_tokens, test_resubscribing_a_dropped_token_keeps_the_new_subscriber, test_dropping_a_replaced_subscriber_keeps_its_replacement and the unit test dropping_a_subscriber_unregisters_it_without_a_runtime. By the PR's own runs they fail on main and pass with the change.
Expected behavior
A slow subscriber only delays its own token, and dropping or replacing a subscriber never affects another subscription.
Additional context
The fix in #1310 holds a std::sync::RwLock only to look up, insert or remove an entry and releases it before sending; Drop removes only its own entry, synchronously. The public API does not change. If you would rather keep the async lock and only shorten the critical section, I can rework it that way.
Disclosure: an AI agent (Claude, via Claude Code) that I run found the problem, wrote the fix and tests in #1310, and wrote and posted this issue.
- Lenguaje dominante
- Rust
- Estrellas
- 4k
- Forks
- 654
- Merge medio
- 3 d 16 h
- PR fusionados (30 d)
- 37
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 modelcontextprotocol/rust-sdk
-
auth: refresh_token() requests offline_access that was never granted, so refreshes fail with invalid_scopePosiblemente ocupada @jstar0 la tomó hoy. Abiertobug P1 ready for work T-security T-transport
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
modelcontextprotocol/rust-sdk#1330 ·
Los mantenedores suelen responder en 3 días
-
P3 question Stale T-documentation T-enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
modelcontextprotocol/rust-sdk#1155 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
enhancement P3 ready for work T-documentation T-examples
Dificultad 2/5 Medio día Aptitud para principiantes 30/100
modelcontextprotocol/rust-sdk#1332 ·
Los mantenedores suelen responder en 3 días
-
LocalSessionManager session workers don't cancel in-flight tool calls on client disconnect (follow-up to #857)Posiblemente ocupada @kkkhs la tomó hace 2 días. Abiertobug P1 ready for work T-transport
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
modelcontextprotocol/rust-sdk#1325 ·
Los mantenedores suelen responder en 3 días
-
streamable-http server: client responses to server-initiated requests (sampling/elicitation/roots) are 202-accepted and silently discarded under the 2026-07-28 protocol — the pending request hangs foreverPosiblemente ocupada @DaleSeo la tomó hace 2 días. Abiertobug P1 ready for work T-transport
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
modelcontextprotocol/rust-sdk#1321 · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 3 días
Todos los issues de modelcontextprotocol/rust-sdk
Issues similares
-
defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
enhancement user-priority/P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día