Skip to content

Retry a request set whose transaction was rolled back by a caught error - #356

Open
chippison wants to merge 1 commit into
6.x-devfrom
dev-20866-centralize-transaction-rollback-handling
Open

chippison wants to merge 1 commit into
6.x-devfrom
dev-20866-centralize-transaction-rollback-handling

Conversation

@chippison

Copy link
Copy Markdown
Contributor

DEV-20866

Follow-up to matomo-org/matomo#25549, which makes the tracker connection refuse every query and the commit after an error that rolled back the transaction.

If a tracking step caught such an error on the last query of a request set, nothing noticed until the lock or commit queries, which then failed outside the retry path. The worker crashed, and the unlock in the error handler failed too, so the lock stayed held until it expired.

  • After each tracked request the handler checks whether the transaction was rolled back, so the set goes down the existing retry path.
  • When processing fails, the processor rolls back before it releases the lock.
  • The retry check uses core's TransactionErrors when it exists.

Both checks are skipped on Matomo versions without the core change. The new HandlerTest case needs the core PR, and is skipped without it.

Review

  • [✔] I have understood, reviewed, and tested all AI outputs before use
  • [✔] All AI instructions respect security, IP, and privacy rules

A tracking step can catch an error after which the database already rolled back the transaction; the set now goes down the retry path, and a failed run rolls back before releasing its lock.
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