feat(proxy-pool): pool service (acquire/release/health) + healthcheck scheduler task (#2162) #2169
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#2169
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/proxy-pool-service"
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?
Закрывает #2162 (Epic #2160, P2). Аддитивно — сервис + health-checker, НЕ подключено к боевым scrapers (P3/P4).
Что
app/services/proxy_pool.py—acquire/release/mark_health/reap_stale_leases+run_proxy_healthcheck. psycopg v3 (CAST,make_interval). Пороги:MAX_CONSECUTIVE_FAILS=3(карантин в acquire),DISABLE_THRESHOLD=5(авто-disable),STALE_LEASE_MINUTES=30. Lease:leased_by IS NULL=свободен /run_id=занят /-1=non-run marker.acquire=FOR UPDATE SKIP LOCKED LIMIT 1.scheduler.py—trigger_proxy_healthcheck_run+ веткаproxy_healthcheckв dispatch. Sub-hourly каденс: после_claim_runпереопределяетnext_run_at = now() + interval_minutes(штатный scheduler суточно-гранулярный);has_running_runавто-throttle.158_seed_proxy_healthcheck_schedule.sql— сид (enabled, interval 30 мин,next_run_at=now()). Безопасно: пул пуст → checked=0.Health-checker
Для каждого enabled прокси — httpx GET ipify через него →
mark_health(ok, exit_ip, latency); предварительноreap_stale_leases.Verify
pytest test_proxy_pool.py→ 14 passed (stateful FakeSession);test_scheduler+test_scheduler_main→ 40 passed (нет регрессии)После мержа
Миграция 158 auto-apply; залить прокси через
POST /api/v1/admin/proxies/bulk→ health-checker начнёт пинговать. Интеграция в боевой fetch = P3 (curl) / P4 (browser).