fix(22d): commit outer transaction in scrape_catalog_objects orchestrator #342
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#342
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/22d-catalog-objects-missing-commit"
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
PR #335 использовал
with db.begin_nested():SAVEPOINT для per-row UPDATE, но outer transaction никогда не commit'ился.Целевая последовательность была:
db = SessionLocal()(autocommit=False)scrape_catalog_objects(db, ...)with db.begin_nested():SAVEPOINT → UPDATEdb.close()— закрывает session без commit → outer autobegin'd tx rollback → все UPDATE'ы теряютсяСимптом: task завершается успешно (
processed=3 succeeded=3), Glitchtip пустой (нет exception), но в БД 0 строк сcatalog_scraped_at != NULL.Fix
Добавлен
db.commit()после batch loop, с rollback fallback:Test plan
POST /admin/scrape/kn-catalog-objects {"max_objects":3}→ проверить чтоwall_type/energy_eff/ceiling_height_mпоявились для 3 obj.Deep review — APPROVE
Fix is correctly placed (after batch loop at line 452, before logger/stats return) and uses proper SQLAlchemy hygiene (commit / except / rollback / raise). No scope creep — SAVEPOINT pattern, Celery lifecycle, and orchestrator signature untouched. Resolves silent data loss where outer autobegin'd tx rolled back at db.close() discarding all per-row UPDATEs.
Merging.