Skip to content
Snippets Groups Projects

Closes #3440043

Closed mondrake requested to merge issue/drupal-3440043:3440043-replace-catch-of into 11.x
1 unresolved thread
Files
3
@@ -328,9 +328,11 @@ public function rollback(string $name, string $id): void {
// If this was the root Drupal transaction, we can rollback the client
// transaction. The transaction is closed.
$this->processRootRollback();
// The Transaction object remains open, and when it will get destructed
// no commit should happen. Void the stack item.
$this->voidStackItem($id);
if ($this->getConnectionTransactionState() === ClientConnectionTransactionState::RolledBack) {
// The Transaction object remains open, and when it will get destructed
// no commit should happen. Void the stack item.
$this->voidStackItem($id);
}
    • Comment on lines -331 to +335
      Author Contributor

      BTW we discover and fix a bug here... ::processRootRollback() above already voids the item, so calling ::voidStackItem() on it fails, since it's removed from the stack.

      The fact that nobody complained (this is a missing offset error just after the warning) probably tells a lot about whether this code path occurs in real world...

      In our testing ATM, we do not get to ::voidStackItem() because in testTransactionWithDdlStatement() the warning is transformed into an exception (in PHPUnit 9), and then caught and never returning to code execution.

Please register or sign in to reply
}
else {
// The stack got corrupted.
Loading