fix(yandex): rotate proxy IP + retry on tarpit-timeout/captcha in combos sweep #1664
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#1664
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/yandex-rotate-on-tarpit"
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?
Summary
Makes the nightly yandex combos sweep resilient to yandex's bandwidth-tarpit anti-bot.
Diagnosis (prod 2026-06-17)
yandex anti-bot = bandwidth tarpit, not captcha/block: it returns HTTP 200 but throttles flagged mobile-proxy IPs to ~77 B/s for realty SERP pages → the large SERP never finishes in the 30s timeout → system curl exits 28 →
status_code=0→fetch_aroundreturns[]. Measured: tarpitted IP = 77 B/s; after_rotate_ipa fresh IP = 24807 B/s, full 459KB SERP in 18.5s with 900+ offers. So rotation defeats the tarpit — fresh IPs aren't all flagged.The bug: the nightly combos path (
fetch_around_multi_room→fetch_around) did NOT rotate/retry — onstatus_code != 200it justreturn []. So when the current IP was tarpitted, all 30 combos returned[]and the IP was never rotated → run yields 0 (prod run 117). The exhaustive path already rotated; the nightly sweep used the non-rotating path.Fix
fetch_aroundnow retries up to_YANDEX_TARPIT_MAX_RETRIES=2times (3 attempts):status_code == 0(tarpit/timeout) → rotate IP +sleep(2)+ retry[](no rotate)[]Worst case 30 combos × 3 fetches × ~17s ≈ 1530s, within the #1659 combos watchdog (2190s). Most fresh IPs succeed on attempt 0.
Test plan
Refs #759, #1658