stdio server stops answering queued requests under CPU contention until more input arrives (lost wakeup?)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- python
- Ambito
- backend, networking
Direzione di ricerca
Start at the FastMCP stdio server’s request-reading and response-dispatch path, then trace how AnyIO worker results wake the asyncio loop under CPU contention. Reproduce with the described driver: send the request lines in one write and leave stdin open while waiting for the missing responses. Done when every request receives a response under contention without needing another input message.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Versions: mcp 1.30.0, anyio 4.16.0, CPython 3.14.7, Linux x86_64.
What happens. A FastMCP stdio server, given several requests in one write, sometimes answers the first few and
then stops: the remaining requests (and a final ping) get no response, with stdin still open, for as long as we
waited (90 s). It happens only under CPU contention. Alone it answered every time (0 of 10 runs stalled). With eight
copies running at once on four cores, 6 of 48 runs stalled. The point where it stops varies between runs: the
missing ids were {6, 7, 999}, {7, 999} or {999}.
Minimal server (no application code):
from mcp.server.fastmcp import FastMCP
m = FastMCP("bare")
@m.tool()
def recall(query: str) -> str:
return "ok"
m.run()
Driver. One write to stdin of these lines, then wait (stdin left open) for responses to ids 3, 4, 6, 7 and 999:
initialize (id 1); notifications/initialized; a malformed line ({not json ...); a request with an unknown
method (id 2); tools/call of an unknown tool (id 3); tools/call of recall with an unknown argument (id 4); a
tools/call whose params is a string (id 5); a batch array; prompts/get of an unknown prompt (id 6);
resources/read of an unknown URI (id 7); ping (id 999).
Stack dump of a stalled server (faulthandler, SIGABRT after 30 s without a response): the main thread is idle in
the asyncio loop's select (epoll_wait), and the AnyIO worker threads are idle in queue.get. No request handler
is running, and nothing is blocked. That looks like a result handed back to the loop without the loop being woken:
a further message sent after the stall gets the outstanding responses answered: a driver that sends an extra
ping after 5 s of silence saw 3 of 40 runs stall under the same load, and all 3 completed after the ping.
Expected: every request read from stdin is eventually answered while stdin is open, whatever the CPU load.
Happy to provide the full driver script and dumps.
- Lingua principale
- Python
- Stelle
- 25k
- Fork
- 4.2k
- Merge medio
- 10m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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/python-sdk
-
v2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
modelcontextprotocol/python-sdk#3978 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Client serves cached tools after its context exits with an exceptionForse già presa @jonxsong l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
modelcontextprotocol/python-sdk#3968 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
modelcontextprotocol/python-sdk#3957 ·
I maintainer di solito rispondono entro 1 giorno
-
v2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
modelcontextprotocol/python-sdk#3934 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug v1
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
modelcontextprotocol/python-sdk#3929 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di modelcontextprotocol/python-sdk
Issue simili
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwiseForse già presa @abdulwaarith0 l’ha presa oggi. Apertaneeds-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
MakazhanAlpamys/Soup#3690 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
bug data-types native-format
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ClickHouse/clickhouse-connect#1320 ·
I maintainer di solito rispondono entro 1 giorno
-
Public benchmark import end-to-end test fails when the test stack's worker runs the parity jobApertaaccepted
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
future-agi/future-agi#6392 ·
I maintainer di solito rispondono entro 1 giorno