fix(workers): count lots_pf failure correctly, no silent done (#1220) #1267
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#1267
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/scrape-objective-lots-pf-failure-count"
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
Closes #1220 (P2 silent-failure, prod).
scrape_objectiveпомечал runstatus='done'при полностью провалившемся главном lots_pf-стриме (~600МБ отчёт «Лоты»). Последний P2 из армии Fable 5 ревью.Bug
scrape_objective.sync_objective_grouplots_pf-ветка:ObjectiveAuthError/ObjectiveAPIError— подклассыRuntimeError ⊂ Exception→ ловятся внутренним generic-except. Внешнийexcept (ObjectiveAuthError, ObjectiveAPIError)для lots_pf недостижим. Итог:_finish_run(status='done' if reports_failed==0)помечает run УСПЕШНЫМ при провале основного отчёта.objective_lots/historystale молча, админкаlast_run_atврёт, downstream supply-layers L2 видит 'done' с rows_lots=0.corp_sum-ветка делает правильно (counter после HTTP) — взят как образец.
Fix
n_requests/reports_okперенесены ИЗ pre-HTTP в after-success (после успешного commit'а внутриwith stream_report(...)).except Exceptionlots_pf-ветке добавленn_requests += 1+reports_failed += 1+logger.exceptionс traceback.Test plan
reports_ok=1, auth-error / api-error / generic Exception в lots_pf инкрементируютreports_failed(неok),_finish_runstatus='failed'приreports_failed>0.pytest tests/workers/tasks/test_scrape_objective.py→ 5 passed.pytest -k scrape_objective→ 5 passed, 1 skipped.ruff check→ clean.Closes #1220