Skip to content

Fix doomed transaction error handling (#756)#757

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/756-doomed-transaction
Mar 29, 2026
Merged

Fix doomed transaction error handling (#756)#757
erikdarlingdata merged 1 commit intodevfrom
fix/756-doomed-transaction

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • calculate_deltas: CATCH block tried to INSERT into collection_log while inside a caller's doomed transaction (XACT_STATE = -1). Added XACT_STATE check and moved error message capture before ROLLBACK.
  • ensure_collection_table: CATCH block did INSERT before ROLLBACK. Reordered to ROLLBACK first.

Fixes #756 — the "cannot be committed" error was masking the real underlying failure during installation validation.

Test plan

  • Deployed fixed procs to sql2022, ran collector successfully
  • Simulated doomed transaction by renaming table mid-collection — real error now propagates correctly
  • OP confirmed clean install passes 45/45 collectors

🤖 Generated with Claude Code

…ollection_table (#756)

When calculate_deltas was called inside a collector's transaction and failed,
the CATCH block tried to INSERT into collection_log while the transaction was
doomed (XACT_STATE = -1), swallowing the real error with "The current transaction
cannot be committed." Same pattern in ensure_collection_table where INSERT
happened before ROLLBACK.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 91f46f7 into dev Mar 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant