feat(gateway): make launched-driver detection non-blocking

Đang mở
#5,940 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:drivers

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_blocking or 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.

Ngôn ngữ chính
Rust
Star
21.5k
Fork
2.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/OpenShell

Tất cả issue của NVIDIA/OpenShell

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.