fix(parcels): SAVEPOINT around velocity → не abort outer tx (analyze 500 fix) #154
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#154
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/velocity-savepoint-aborted-tx"
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?
Bug
POST
/parcels/{cad}/analyze→ 500:Root cause
compute_velocity()SQL fails (например на sparse sale_graph) → exception caught → НО db.rollback() отсутствует → transaction остаётся в aborted state. Следующая query (_geotech_risk на line 828) → InFailedSqlTransaction.Fix
Wrap velocity в
with db.begin_nested()— SAVEPOINT pattern (consistent с PR #124 pzz_loader fix).Impact
POST /parcels/{cad}/analyzeбольше не 500. На failure velocity →velocity: null.После merge — deploy auto-redeploys backend, прод работает.
Refs: user report 2026-05-15
Final review (SHA
b08597b, CI ✅)Корректный fix для psycopg
InFailedSqlTransactionпосле PR #146 velocity integration:✅ Root cause: PG abort'ит entire transaction на любой SQL error; Python try/except ловит Python exception но connection остаётся в aborted state → следующая query крашится
✅
db.begin_nested()SAVEPOINT — standard fix, auto-rollback на exception оставляет outer tx clean (velocity_data = None, остальной flow продолжается)✅ Consistent с PR #124 (pzz_loader) — reuse идиомы из codebase
✅ Inline-комментарий объясняет why этот pattern нужен
✅ Tiny surgical (+7/-3), CI зелёный
approve merge