Skip to content

fix(browser): 조회 timeout만 지역 단위 1회 재시도(재로드), 지역 이름 진단 - #21

Merged
digitie merged 2 commits into
mainfrom
fix/region-search-retry-and-diagnostics
Oct 12, 2026
Merged

digitie merged 2 commits into
mainfrom
fix/region-search-retry-and-diagnostics

Conversation

@digitie

@digitie digitie commented Oct 12, 2026

Copy link
Copy Markdown
Owner

요약

kor-travel-transport fuel_collection_job의 상류 실패(지역 검색 응답 60초 timeout)를 줄이고 진단을 고칩니다(소유자 승인 2026-10-12).

  • 재시도: 조회 검색 클릭 단계의 timeout(_SearchResponseTimeoutError)만 지역 단위로 1회 재시도합니다.
    • 재시도 전에 검색 페이지를 다시 열고(origin과 차단 페이지 검사 포함), 탭을 다시 활성화하고, 지역을 처음부터 다시 선택합니다. 첫 시도에 늦게 온 응답이나 남은 드롭다운 상태가 섞이지 않게 하려는 것입니다.
    • 재시도도 action pacing과 max_search_requests 예산을 그대로 따릅니다.
    • 드롭다운 선택 단계 timeout, 결과 DOM timeout(차단·빈 페이지일 수 있음), 인증·429·차단·파싱 오류는 재시도하지 않습니다.
  • 관측: 재시도할 때마다 경고 로그를 남기고, OpinetBrowserSnapshot.region_retry_count(기본 0)에 셉니다.
  • 진단: target=non-numeric 대신 지역을 코드로, 코드가 없으면 한글·숫자 12자 이내 이름으로 남깁니다. 예: region=경기도/용인시수지구:attempt=2.

검증

  • n150에서 Python 3.11·3.13 모두 mypy 통과, 274 passed / 1 skipped(Playwright 브라우저 테스트).
  • coverage 93.6%, browser.py는 95%.
  • 새 테스트: 선택 단계 timeout은 재시도하지 않고 reload도 일어나지 않음, 검색 클릭 timeout은 reload → 탭·지역 재선택 → 재검색 순서로 진행됨, 재시도 카운터 값.
  • 적대 리뷰 2회: 첫 리뷰의 MED(무리로드 재시도로 다른 시도의 같은 이름 구가 병합될 수 있음)를 반영했습니다.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RuoPRjkdpZNYjTZ1RYQoHj

digitie and others added 2 commits October 12, 2026 13:03
…n in diagnostics

- A region (sigungu) search that fails on a response-wait timeout is retried
  once for that region only. The retry keeps the action pacing (_pause) and
  is charged against max_search_requests; with no headroom it fails with
  retry=budget-exhausted. Auth/429/blocked/parse errors are never retried.
- Selection/search failure phases carry a sanitized region identity instead
  of target=non-numeric: numeric codes verbatim, otherwise Hangul+digits
  truncated to 12 chars as sido/sigungu(/dong), plus attempt/attempts.
- Raw post-response DOM wait timeouts are reported in the same redacted form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuoPRjkdpZNYjTZ1RYQoHj
Review MED: a selection-stage timeout was retried on the same page. On the
second attempt _select_value saw the value already selected and skipped the
response validation and the dependent-options wait, so a late response or a
same-named sigungu (중구/동구) in another sido could merge the wrong region.

- Only a timeout waiting for the search response after the 조회 click
  (_SearchResponseTimeoutError) is retried. Selection-stage timeouts and
  results-DOM wait timeouts (possibly a blocked/blank page) fail as before.
- Before the retry the search page is reopened (page.goto with origin and
  block checks), the tab re-activated and the region re-selected from
  scratch, so attempt 2 cannot consume attempt 1's late response.
- A successful retry logs a warning with the region label and is counted in
  OpinetBrowserSnapshot.region_retry_count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuoPRjkdpZNYjTZ1RYQoHj
@digitie
digitie merged commit 4654310 into main Oct 12, 2026
4 checks passed
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.

1 participant