fix(registry,crud,restart): defer rows.Close() to prevent cursor leaks #2037

Closed
core-be wants to merge 2 commits from fix/defer-rows-close-audit into staging
Member
No description provided.
core-be added 1 commit 2026-06-01 03:36:12 +00:00
fix(registry,crud,restart): defer rows.Close() to prevent cursor leaks
E2E API Smoke Test / E2E API Smoke Test (pull_request) Blocked by required conditions
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Blocked by required conditions
Harness Replays / Harness Replays (pull_request) Blocked by required conditions
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Blocked by required conditions
branch-protection drift check / Branch protection drift (pull_request) Successful in 4s
cascade-list-drift-gate / check (pull_request) Successful in 3s
Check merge_group trigger on required workflows / Required workflows have merge_group trigger (pull_request) Successful in 3s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 15s
Check migration collisions / Migration version collision check (pull_request) Successful in 10s
CI / Detect changes (pull_request) Successful in 9s
CodeQL / Analyze (${{ matrix.language }}) (javascript-typescript) (pull_request) Failing after 2s
CodeQL / Analyze (${{ matrix.language }}) (go) (pull_request) Failing after 4s
CodeQL / Analyze (${{ matrix.language }}) (python) (pull_request) Failing after 5s
E2E API Smoke Test / detect-changes (pull_request) Successful in 10s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 9s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
Lint curl status-code capture / Scan workflows for curl status-capture pollution (pull_request) Successful in 5s
Harness Replays / detect-changes (pull_request) Successful in 6s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 8s
qa-review / approved (pull_request) Successful in 4s
security-review / approved (pull_request) Successful in 4s
Secret scan / Scan diff for credential-shaped strings (pull_request) Failing after 28s
sop-checklist / review-refire (pull_request) Has been skipped
sop-checklist / na-declarations (pull_request) N/A: (none)
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 31s
Runtime Pin Compatibility / PyPI-latest install + import smoke (pull_request) Successful in 2m5s
gate-check-v3 / gate-check (pull_request) Successful in 7s
sop-checklist / all-items-acked (pull_request) Successful in 6s
sop-tier-check / tier-check (pull_request) Successful in 5s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 12s
CI / Canvas (Next.js) (pull_request) Failing after 2m36s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 7s
CI / Platform (Go) (pull_request) Successful in 3m1s
CI / Python Lint & Test (pull_request) Failing after 7m7s
00ae7cdd38
- workspace_crud.go: defer descRows.Close() in cascade-delete descendant query
- orphan_sweeper.go: defer knownRows.Close() in wiped-DB reverse-lookup
- restart_context.go: defer rows.Close() in global + workspace secret key scans

All sites previously used explicit Close() which leaks on panic or early-return.
Defers close at block exit regardless of control flow.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
core-be changed target branch from main to staging 2026-06-01 03:39:58 +00:00
core-be force-pushed fix/defer-rows-close-audit from 00ae7cdd38 to 5bbf60bc4b 2026-06-01 04:15:08 +00:00 Compare
core-be added 1 commit 2026-06-01 12:40:55 +00:00
ci: remove unused canvasUserMessage type to fix lint on staging
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Detect changes (pull_request) Successful in 10s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 30s
E2E API Smoke Test / detect-changes (pull_request) Successful in 17s
E2E Chat / detect-changes (pull_request) Successful in 11s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
CI / Platform (Go) (pull_request) Successful in 6m5s
CI / Canvas (Next.js) (pull_request) Successful in 7m45s
CI / Python Lint & Test (pull_request) Successful in 7m1s
CI / all-required (pull_request) Successful in 6m8s
Harness Replays / detect-changes (pull_request) Successful in 6s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m14s
gate-check-v3 / gate-check (pull_request_target) Successful in 8s
qa-review / approved (pull_request_target) Successful in 6s
security-review / approved (pull_request_target) Successful in 9s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 6s
sop-tier-check / tier-check (pull_request_target) Successful in 5s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
Harness Replays / Harness Replays (pull_request) Successful in 12s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m26s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m27s
E2E Chat / E2E Chat (pull_request) Failing after 7m21s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 3s
audit-force-merge / audit (pull_request_target) Has been skipped
a7d8104979
internal/handlers/a2a_proxy_helpers.go:412 had an unused struct that
causes golangci-lint `unused` failure on every PR targeting staging.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Member

Closing — based on the dead staging fork; this fix is already on main. main already defers rows.Close() in loadRestartContextData (restart_context.go:136,150) and CascadeDelete (workspace_crud.go:547); orphan_sweeper already closes the cursor and checks knownRows.Err() (orphan_sweeper.go:270-273). The a2a_proxy_helpers.go hunk is just catching the branch up to main (canvasUserMessage already removed there). Per the staging-deprecation cleanup; target main for future PRs.

Closing — based on the dead `staging` fork; this fix is already on `main`. main already defers rows.Close() in loadRestartContextData (restart_context.go:136,150) and CascadeDelete (workspace_crud.go:547); orphan_sweeper already closes the cursor and checks knownRows.Err() (orphan_sweeper.go:270-273). The a2a_proxy_helpers.go hunk is just catching the branch up to main (canvasUserMessage already removed there). Per the staging-deprecation cleanup; target `main` for future PRs.
devops-engineer closed this pull request 2026-06-01 18:28:12 +00:00
Some required checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Detect changes (pull_request) Successful in 10s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 30s
E2E API Smoke Test / detect-changes (pull_request) Successful in 17s
E2E Chat / detect-changes (pull_request) Successful in 11s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 6s
CI / Platform (Go) (pull_request) Successful in 6m5s
CI / Canvas (Next.js) (pull_request) Successful in 7m45s
CI / Python Lint & Test (pull_request) Successful in 7m1s
CI / all-required (pull_request) Successful in 6m8s
Required
Details
Harness Replays / detect-changes (pull_request) Successful in 6s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 9s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 5s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m14s
gate-check-v3 / gate-check (pull_request_target) Successful in 8s
qa-review / approved (pull_request_target) Successful in 6s
security-review / approved (pull_request_target) Successful in 9s
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4 — body-unfilled: comprehensive-testing, local-postgres-e2
Required
Details
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request_target) Successful in 6s
sop-tier-check / tier-check (pull_request_target) Successful in 5s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
Harness Replays / Harness Replays (pull_request) Successful in 12s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2m26s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m27s
E2E Chat / E2E Chat (pull_request) Failing after 7m21s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 3s
audit-force-merge / audit (pull_request_target) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2037