Issue #2067551 by lokapujya, Kartagis, sandipmkhairnar, jlindsey15: /core/lib/Drupal/Core/Routing/MatcherDumper.php will never roll back its transaction.
parent
52d3b49336
commit
51e320178e
|
@ -109,19 +109,20 @@ class MatcherDumper implements MatcherDumperInterface {
|
|||
// Delete any old records in this provider first, then insert the new ones.
|
||||
// That avoids stale data. The transaction makes it atomic to avoid
|
||||
// unstable router states due to random failures.
|
||||
$txn = $this->connection->startTransaction();
|
||||
|
||||
$this->connection->delete($this->tableName)
|
||||
->condition('provider', $options['provider'])
|
||||
->execute();
|
||||
|
||||
$insert->execute();
|
||||
|
||||
// We want to reuse the dumper for multiple providers, so on dump, flush
|
||||
// the queued routes.
|
||||
$this->routes = NULL;
|
||||
|
||||
// Transaction ends here.
|
||||
$transaction = $this->connection->startTransaction();
|
||||
try {
|
||||
$this->connection->delete($this->tableName)
|
||||
->condition('provider', $options['provider'])
|
||||
->execute();
|
||||
$insert->execute();
|
||||
// We want to reuse the dumper for multiple providers, so on dump, flush
|
||||
// the queued routes.
|
||||
$this->routes = NULL;
|
||||
} catch (\Exception $e) {
|
||||
$transaction->rollback();
|
||||
watchdog_exception('Routing', $e);
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue