From 5846baedc7bfcc91d0b113f0b681798b3a76da15 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Sat, 16 May 2026 19:46:49 +0900 Subject: [PATCH] =?UTF-8?q?fix(search):=20ask=20classifier=20wait=5Ffor=20?= =?UTF-8?q?6s=20=E2=86=92=2015s=20(outer=20wrapper=20override=20=ED=95=B4?= =?UTF-8?q?=EC=86=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A1 (LLM_TIMEOUT_MS 5→15→30) + config(10→15→30) 후속 진단: 8/10 fixture query 가 "classifier ok" 또는 "classifier error" 로그 없이 conservative_refuse(no_classifier) 경로. search.py:518 의 outer wrapper `asyncio.wait_for(classifier_task, timeout=6.0)` 가 classifier_service.LLM_TIMEOUT_MS 와 httpx timeout 모두 override. 6s 한계 → 동시 부하 시 거의 모든 classifier 호출 6s 안에 못 끝남 → AsyncIO TimeoutError → ClassifierResult("timeout") → refusal_gate 가 verdict=None 받아 conservative_refuse. 15s 로 상향 — classifier_service 내부 30s 와 align 하지 않은 이유 = ask 응답 시간 상한 유지 (evidence parallel 종료 후 추가 9s 대기 cap). Mac mini 26B 동시 부하 시 실측 elapsed 11-14s 까지 자주 발생 → 15s 가 합리 균형. 본 fix 가 진짜 closure 효과. PR-Hermes-Docsrv-Search-1 Layer 1 fixture 의 8/10 no_classifier 경로 해소 예상. --- app/api/search.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/api/search.py b/app/api/search.py index 8b10663..e1badb3 100644 --- a/app/api/search.py +++ b/app/api/search.py @@ -514,8 +514,12 @@ async def ask( ev_ms = (time.perf_counter() - t_ev) * 1000 # classifier await (timeout 보호 — classifier_service 내부에도 있지만 여기서 이중 보호) + # 2026-05-17: 6s outer wrapper 가 classifier_service.LLM_TIMEOUT_MS (30s) 를 override → 동시 부하 시 + # 거의 모든 classifier 호출 timeout → conservative_refuse(no_classifier) 경로. 15s 로 상향 — classifier + # 가 실제 작동하도록 (단, ask 전체 응답 시간 상한 영향: ev_ms + max(classifier_wait, evidence_extract) + + # synth_ms + verifier 누적). try: - classifier_result = await asyncio.wait_for(classifier_task, timeout=6.0) + classifier_result = await asyncio.wait_for(classifier_task, timeout=15.0) except (asyncio.TimeoutError, Exception): classifier_result = ClassifierResult("timeout", None, [], [], 0.0)