fix(avito): reconnect-retry on detail 429 under backconnect proxy #1771
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1771
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/avito-detail-429-reconnect"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem (prod detail backfill run 217)
The detail backfill enriched only 19 then aborted at the task's
max_consecutive_blocks=5guard — all 5 blocks were HTTP 429 (backconnect conn-limit). #1768 added 403/firewall reconnect to the detail fetcher, but the 429 path only had a same-session short-retry (no reconnect). The 429s are persistent because the keep-alive session reuses one backconnect exit IP across sequential detail fetches → avito rate-limits that IP.Fix — mirror #1769's SERP 429 reconnect into the detail fetcher
_AVITO_DETAIL_429_MAX_RETRIES4 → 8 (same-session short-retry, first line — unchanged path)._AVITO_DETAIL_429_RECONNECT_RETRIES=3: on 429 short-retry exhaustion under backconnect, up to 3 ephemeral-session reconnects (fresh exit IP) before raisingAvitoRateLimitedError.retry_session/finallymachinery the 403 path already has — the caller-provided shared session is never closed/rebuilt; the single ownership-guardedfinallycovers both 403 and 429 triggers. 403/firewall, browser mode, and no-proxy paths untouched.Tests
New
tests/scrapers/test_avito_detail_429_reconnect.py(4): short-retry-exhausted→reconnect→200 (asserts caller session not closed, ephemeral closed); fully exhausted→AvitoRateLimitedError(3 reconnects); 429→200 within budget→no reconnect (regression); no-proxy→raise immediately.-k "avito and detail": 14 passed. Ruff clean.Last of the avito ban-vector fixes: 403 (#1764/#1765), SERP 429 (#1769), detail 403 (#1768), and now detail 429. Unblocks detail-coverage growth past the current ~11%.