fix(mcp): McpServerController.start/stop race creates a second socket host and leaks the first
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Dart
- Estrelas
- 23
- Forks
- 1
- Merge médio
- 31min
- PRs com merge (30d)
- 570
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de QueryaHub/Querya-Desktop
-
enhancement ui
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Mantenedores costumam responder em até 1 dia
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbertabug frontend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Mantenedores costumam responder em até 1 dia
-
bug error-handling settings
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Mantenedores costumam responder em até 1 dia
-
enhancement marketplace
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de QueryaHub/Querya-Desktop
Issues semelhantes
-
Images copied with `adb push` don't show in the wallpaper picker ("No images found on device")Aberta
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 82/100
meddouribadis/arclauncher#53 ·
Mantenedores costumam responder em até 1 dia
-
enhancement help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Cadman021/VeloceNet-Studio#35 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
ymm-oss/flutter-mobile-project-template#684 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
mill-road-winter-fair/mill_road_winter_fair_app#596 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia