fix(mcp): McpServerController.start/stop race creates a second socket host and leaks the first
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start with lib/core/mcp/mcp_server_controller.dart:102-124 and trace how start() and stop() handle overlapping calls and the host.changes subscription. Add tests for two concurrent start() calls creating one host and for stop() during startup ending in a stopped state; done when both behaviors pass and the subscription is cancelled on stop.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
McpServerController.start() (lib/core/mcp/mcp_server_controller.dart:102-124) checks _host != null first, then awaits _version() and host.start(), and assigns _host only after that. Two overlapping calls (startIfEnabled + setEnabled(true), repeated toggle, regenerateToken) create two McpSocketHosts: the first is leaked (never stopped), both write the same endpoint file and the token in the file may not belong to the host that is tracked.
stop() during an in-flight start() sees _host == null, does nothing, and the server comes up afterwards while the setting says disabled.
host.changes.listen is also never cancelled.
Expected
- Serialize start / stop (single in-flight future or a lock) and assign
_hostbefore the first await. - Cancel the
changessubscription on stop. - Test: concurrent
start()x2 yields one host;stop()duringstart()ends stopped.
- Lingua principale
- Dart
- Stelle
- 23
- Fork
- 1
- Merge medio
- 31m
- PR unite (30g)
- 570
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- 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 QueryaHub/Querya-Desktop
-
enhancement ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1689 ·
I maintainer di solito rispondono entro 1 giorno
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowApertabug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
QueryaHub/Querya-Desktop#1642 ·
I maintainer di solito rispondono entro 1 giorno
-
bug error-handling settings
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1637 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
QueryaHub/Querya-Desktop#1636 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement marketplace
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1635 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QueryaHub/Querya-Desktop
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
avdept/JellyBoxPlayer#375 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
basictech01/uniun#300 ·
I maintainer di solito rispondono entro 1 giorno
-
Listener that removes itself in its callback causes other listeners to miss updatesForse già presa @RaphaelFakhri l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
RevenueCat/purchases-flutter#1962 ·
I maintainer di solito rispondono entro 1 giorno