Skip to content

fix(db): convert driver exceptions raised by COMMIT - #64506

Open
hamza221 wants to merge 1 commit into
masterfrom
fix/db/retry-deadlock-raised-at-commit
Open

hamza221 wants to merge 1 commit into
masterfrom
fix/db/retry-deadlock-raised-at-commit

Conversation

@hamza221

@hamza221 hamza221 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Assisted-by: ClaudeCode:claude-opus-5

  • Resolves: #

Summary

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Doctrine converts driver-level exceptions into typed DBAL exceptions for
queries, but Connection::doCommit() leaves them untouched. A deadlock, or a
Galera certification failure, raised at commit time therefore surfaced as a
raw Doctrine\DBAL\Driver\PDO\PDOException. That class implements the driver
exception interface, not Doctrine\DBAL\Exception, so
ConnectionAdapter::commit() never wrapped it into a DbalException and the
retry loop in Propagator::propagateChange() never saw it. The error reached
the user as an HTTP 500, shown as "unknown error" in the web interface, when
several uploads updated the same parent folder rows at once. Group folders
hit this often because every member shares one storage.

Run the driver exception through the platform exception converter so error
1213 becomes a DeadlockException and callers can detect it as retryable.

Also guard both rollback calls in the propagator. A failed commit has
already ended the transaction, so rolling back throws "there is no active
transaction" and masks the original error.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221
hamza221 force-pushed the fix/db/retry-deadlock-raised-at-commit branch from 4491588 to 82c4d54 Compare September 24, 2026 13:48
@hamza221
hamza221 marked this pull request as ready for review September 24, 2026 14:32
@hamza221
hamza221 requested a review from a team as a code owner September 24, 2026 14:32
@hamza221
hamza221 requested review from Altahrim, leftybournes, salmart-dev and sorbaugh and removed request for a team September 24, 2026 14:32
@hamza221 hamza221 added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 24, 2026
@hamza221 hamza221 added this to the Nextcloud 36 milestone Sep 24, 2026
@hamza221

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@hamza221

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@hamza221

Copy link
Copy Markdown
Contributor Author

/backport to stable33

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants