Skip to content

Fix errors in service router worker sync - #4305

Open
un-def wants to merge 1 commit into
masterfrom
issue_4300_fix_router_worker_sync_exceptions
Open

un-def wants to merge 1 commit into
masterfrom
issue_4300_fix_router_worker_sync_exceptions

Conversation

@un-def

@un-def un-def commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator
  • Fixed two DetachedInstanceError due to missing RunModel.run_name and JobModel.job_name.
  • Fixed Could not fetch server_info for worker ...: ReadError('') logged as an error with a traceback, repeating until the worker is ready. An SSH tunnel to a port nobody listens on yet fails with httpx.ReadError, so this is the normal startup path. Both _probe_http_worker() and _get_router_workers() now catch httpx.RequestError and log it at the debug level.

Also:

  • _get_router_workers() returns None instead of [] when the response cannot be read. [] means "the router has no workers", so an unexpected status, an unparsable body, or a missing workers key made the sync re-register every worker.
  • Bare except Exception clauses are replaced with the exceptions actually expected, so a programming error is no longer reported as an unready replica. sync_router_workers_for_run_model() logs such errors itself instead of letting them escape to the pipeline worker, which leaves the sync row locked until the lock expires.
  • _get_worker() takes the replica address instead of two pre-built URLs, and each probe builds the URL it registers the worker under. _get_http_worker(), _get_grpc_worker(), and _discover_grpc_server_info() are folded into loops over the connection modes and the runtime types to probe.

Fixes: #4300

* Fixed two `DetachedInstanceError` due to missing `RunModel.run_name`
  and `JobModel.job_name`.
* Fixed `Could not fetch server_info for worker ...: ReadError('')`
  logged as an error with a traceback, repeating until the worker is
  ready. An SSH tunnel to a port nobody listens on yet fails with
  `httpx.ReadError`, so this is the normal startup path. Both
  `_probe_http_worker()` and `_get_router_workers()` now catch
  `httpx.RequestError` and log it at the debug level.

Also:

* `_get_router_workers()` returns `None` instead of `[]` when the
  response cannot be read. `[]` means "the router has no workers", so
  an unexpected status, an unparsable body, or a missing `workers` key
  made the sync re-register every worker.
* Bare `except Exception` clauses are replaced with the exceptions
  actually expected, so a programming error is no longer reported as
  an unready replica. `sync_router_workers_for_run_model()` logs such
  errors itself instead of letting them escape to the pipeline worker,
  which leaves the sync row locked until the lock expires.
* `_get_worker()` takes the replica address instead of two pre-built
  URLs, and each probe builds the URL it registers the worker under.
  `_get_http_worker()`, `_get_grpc_worker()`, and
  `_discover_grpc_server_info()` are folded into loops over the
  connection modes and the runtime types to probe.

Fixes: #4300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Errors in server logs while deploying a service with a type: sglang router

1 participant