fix(workers): 보류 분류에 라우터 502/504 추가 — upstream 절단이 라우터 경유에선 502 로 표면화

llm_router.py 실측: upstream 연결 실패/생성 중 절단 = HTTPException 502 (4곳).
맥북 sleep 절단의 실제 표면이라 503 단독 분류는 보류 누락 → 502/503/504 로 확장.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
hyungi
2026-06-11 13:00:55 +09:00
parent 88e5893041
commit e7c7a2091f
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -139,12 +139,14 @@ def is_deferrable_error(exc: Exception) -> bool:
보류 = 맥북 일시 불가 신호:
- HTTP 503 (라우터 upstream_cold / editor_busy / warming — no-silent-fallback 계약)
- HTTP 502/504 (라우터가 upstream 연결 실패·생성 도중 절단을 502 로 변환 —
llm_router.py 실측 4곳. 맥북 sleep 절단이 라우터 경유 토폴로지에선 이걸로 표면화)
- httpx.TransportError 전계열 (ConnectError·ReadError·RemoteProtocolError +
ConnectTimeout·ReadTimeout 등) — 연결 실패와 생성 도중 sleep 절단을 모두 포함.
ConnectTimeout·ReadTimeout 등) — 라우터 자체 불가 / DS↔라우터 구간 절단.
그 외(400/500, 파싱/검증 오류 등)는 보류가 아니라 호출자의 기존 실패 경로.
"""
if isinstance(exc, httpx.HTTPStatusError):
return exc.response.status_code == 503
return exc.response.status_code in (502, 503, 504)
return isinstance(exc, httpx.TransportError)
+4 -2
View File
@@ -36,9 +36,11 @@ def _http_status_error(status: int) -> httpx.HTTPStatusError:
@pytest.mark.parametrize("exc", [
_http_status_error(503), # 라우터 upstream_cold/editor_busy/warming
httpx.ConnectError("connection refused"), # 맥북 sleep — 연결 자체 불가
_http_status_error(502), # 라우터: upstream 연결 실패/생성 중 절단 변환
_http_status_error(504),
httpx.ConnectError("connection refused"), # 라우터 자체 불가
httpx.ConnectTimeout("connect timeout"),
httpx.ReadTimeout("read timeout"), # 생성 도중 sleep 절단
httpx.ReadTimeout("read timeout"), # DS↔라우터 구간 절단
httpx.ReadError("connection reset"),
httpx.RemoteProtocolError("server disconnected"),
])