ProgressDispatcher: a slow progress subscriber blocks subscribe() and delivery for other tokens
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 4k
- Fork
- 654
- Merge medio
- 4g 2h
- PR unite (30g)
- 40
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/rust-sdk
-
P3 question T-documentation T-enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
modelcontextprotocol/rust-sdk#1155 ·
I maintainer di solito rispondono entro 3 giorni
-
bug P1 ready for work T-transport
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
modelcontextprotocol/rust-sdk#1325 ·
I maintainer di solito rispondono entro 3 giorni
-
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 foreverForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug P1 ready for work T-transport
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
modelcontextprotocol/rust-sdk#1321 ·
I maintainer di solito rispondono entro 3 giorni
-
Bound pre-lifecycle bootstrap attempts in server initializationForse già presa @DaleSeo l’ha presa 3 giorni fa. Apertaenhancement P2 T-service T-transport
modelcontextprotocol/rust-sdk#1315 · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
transport::stdio() runs every read and write on tokio's blocking pool, which caps stdio throughputForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaenhancement P2 T-transport
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
modelcontextprotocol/rust-sdk#1301 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di modelcontextprotocol/rust-sdk
Issue simili
-
feature request good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
TabularisDB/tabularis#853 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
andrewdavidmackenzie/jonesy#267 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 4 giorni
-
`future_into_py` loses the original panic messageForse già presa @Danipulok l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
PyO3/pyo3-async-runtimes#91 ·
-
Signals (Failure Detector): a tool call and its own execution are reported as a repeated callAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno