feat(gateway): make launched-driver detection non-blocking
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 55/100
Direção de pesquisa
Start in crates/openshell-server/src/cli.rs, where run_cli calls prepare_server_config_with_drivers synchronously from async code, then follow the call into launcher::start, which polls with std:🧵:sleep for up to 30 seconds per candidate. Move that blocking work off the runtime with spawn_blocking or an async start path, and document the detection timeout separately from the explicit-launch timeout. Done means a test where a driver never binds its socket shows detection failing within the documented bound without holding a Tokio worker.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
User Story
I run the gateway with launched compute drivers (Docker, Podman, VM) and rely on auto-detection when no driver is named. I directly encountered, while reviewing the launcher, that detection blocks a runtime thread while it waits for a driver to start. This affects how long the gateway takes to fail when a driver hangs.
Problem Statement
Auto-detection runs inside prepare_server_config_with_drivers, which run_cli calls synchronously from async code (crates/openshell-server/src/cli.rs). For each candidate, launcher::start spawns the driver and polls with std::thread::sleep until the driver binds its socket or exits, with a 30 second timeout per candidate. A driver that hangs before binding blocks the calling runtime thread for up to 30 seconds, one candidate at a time.
Impact / Why This Matters
At startup nothing else is served yet, so the effect is a slower failure, not a stall of other work. The same pattern existed for Podman before the launcher change: socket discovery ran synchronously and polled podman info for up to 5 seconds. The launcher change raised the worst case to 30 seconds per candidate. Making detection non-blocking would remove a surprising blocking call from async code and make the timeout a deliberate choice.
Desired Workflow
Detection does not block a runtime thread. The gateway starts each candidate without holding a runtime worker, and the detection timeout is chosen deliberately, separately from the timeout for an explicitly selected driver. Success: a hanging driver delays startup by a bounded, documented time and never blocks a runtime worker.
Acceptance Criteria
- Detection runs without blocking a Tokio worker, for example through
spawn_blockingor an async start path. - The detection timeout is documented, and an explicit launch keeps its own timeout.
- A test covers a driver that never binds its socket.
Related: #5384, #5385. Deferred from the launcher PR to keep that change free of new behaviour.
- Linguagem predominante
- Rust
- Estrelas
- 21.5k
- Forks
- 2.1k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- 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 NVIDIA/OpenShell
-
state:triage-needed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
-
state:triage-needed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
bug: Ready=False/PodTerminating is treated as a terminal sandbox failureTalvez já em andamento @TaylorMutch assumiu há 9 dias. Abertastate:accepted state:pr-opened
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
state:triage-needed
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
-
state:triage-needed
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Todas as issues de NVIDIA/OpenShell
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 2 dias
-
autofixer: follow-up
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
tursodatabase/turso#12531 ·
Mantenedores costumam responder em até 1 dia
-
bug help wanted ui
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
userFRM/egui-charts#4292 ·
Mantenedores costumam responder em até 1 dia
-
CHANGELOG.md out of dateAbertaIssue-Bug Need-Review
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 85/100
PowerShell/DSC#1832 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia