fix(insta-render): 큐 연결 socket_timeout=30 (None→30 교정)

근본원인 실험 확정: redis-py 블로킹 read에서 socket_timeout이 BLMOVE 블록(5s)
이하/None이면 read_timeout 경계 경합으로 간헐 "Timeout reading" → dequeue 실패
→ 슬레이트 draft 정지. socket_timeout 10/30은 모든 실험에서 안정. 블록보다 큰
30으로 명시(직전 None 커밋은 단독 테스트만 통과시켜 오도 — 재사용 패턴서 깨짐).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-08 03:17:34 +09:00
parent c451f5313b
commit 6774067505
2 changed files with 14 additions and 16 deletions

View File

@@ -224,12 +224,9 @@ async def test_poll_once_returns_false_on_timeout(monkeypatch):
fake_queue.fail.assert_not_awaited()
def test_make_queue_redis_no_read_timeout():
"""BLMOVE(블록 5s) dequeue가 read-timeout으로 깨지지 않도록 socket_timeout=None 보장 (회귀 가드)."""
import os, sys
_here = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(_here)) # services/insta-render
sys.path.insert(0, os.path.dirname(os.path.dirname(_here))) # services (_shared)
import worker
def test_make_queue_redis_socket_timeout_exceeds_block():
"""BLMOVE(블록 5s) dequeue가 read-timeout 경계 경합으로 깨지지 않도록
socket_timeout이 블록보다 충분히 커야 한다 (회귀 가드)."""
c = worker.make_queue_redis()
assert c.connection_pool.connection_kwargs.get("socket_timeout") is None
st = c.connection_pool.connection_kwargs.get("socket_timeout")
assert st is not None and st > 5 # blmove 블록(5s)보다 커야 안정