Skip to content

fix(base/server): return HTTP error responses instead of dropping connection in WorkerService#696

Merged
nyannyacha merged 3 commits intomainfrom
ny/server-improvement
Apr 24, 2026
Merged

fix(base/server): return HTTP error responses instead of dropping connection in WorkerService#696
nyannyacha merged 3 commits intomainfrom
ny/server-improvement

Conversation

@nyannyacha
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Improvement

Description

Fixed two cases in WorkerService where the TCP connection was dropped without sending an HTTP response when the worker failed to respond.

  • res_rx.await failure (worker dropped the oneshot sender) -> now returns 500 instead of dropping the connection
  • cancel.is_cancelled() after awaiting response -> now returns 503 instead of dropping the connection

Dropping the TCP connection without a response causes ELB to report 502 Bad Gateway even when the worker process itself is still alive, resulting in spurious 502s.

Both cases now include x-served-by: base/server header to distinguish responses handled at the HTTP server layer from those served by the worker.

@nyannyacha nyannyacha changed the title Fix memory count rollback on allocation failure fix(base/server): return HTTP error responses instead of dropping connection in WorkerService Apr 24, 2026
@johnstonmatt johnstonmatt self-requested a review April 24, 2026 03:59
@nyannyacha nyannyacha force-pushed the ny/server-improvement branch from 3a31ef5 to 4146ba1 Compare April 24, 2026 04:05
@nyannyacha nyannyacha merged commit c47d831 into main Apr 24, 2026
4 checks passed
@nyannyacha nyannyacha deleted the ny/server-improvement branch April 24, 2026 04:23
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.

2 participants