summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-05-13 13:13:04 +0200
committerGitHub <noreply@github.com>2023-05-13 13:13:04 +0200
commite18f97fc9506ec14487d68f90edfef4c6eb98361 (patch)
tree12717286f73200b5f128b5ae9a830fb96503a056 /lib/private
parent8cab1d73ac5c153679b7d1b4b450fc05e99a3135 (diff)
parent3bdd7701297fa0958dddf11e69668dfafe2fa990 (diff)
downloadnextcloud-server-e18f97fc9506ec14487d68f90edfef4c6eb98361.tar.gz
nextcloud-server-e18f97fc9506ec14487d68f90edfef4c6eb98361.zip
Merge pull request #37709 from nextcloud/bugfix/deadlock
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/DB/Exceptions/DbalException.php5
-rw-r--r--lib/private/Files/Cache/Propagator.php8
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/private/DB/Exceptions/DbalException.php b/lib/private/DB/Exceptions/DbalException.php
index f9610c5bf25..2b860a50ff3 100644
--- a/lib/private/DB/Exceptions/DbalException.php
+++ b/lib/private/DB/Exceptions/DbalException.php
@@ -37,6 +37,7 @@ use Doctrine\DBAL\Exception\InvalidArgumentException;
use Doctrine\DBAL\Exception\InvalidFieldNameException;
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
+use Doctrine\DBAL\Exception\RetryableException;
use Doctrine\DBAL\Exception\ServerException;
use Doctrine\DBAL\Exception\SyntaxErrorException;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
@@ -74,6 +75,10 @@ class DbalException extends Exception {
);
}
+ public function isRetryable(): bool {
+ return $this->original instanceof RetryableException;
+ }
+
public function getReason(): ?int {
/**
* Constraint errors
diff --git a/lib/private/Files/Cache/Propagator.php b/lib/private/Files/Cache/Propagator.php
index 4bf88a60843..70fc238d9be 100644
--- a/lib/private/Files/Cache/Propagator.php
+++ b/lib/private/Files/Cache/Propagator.php
@@ -24,7 +24,7 @@
namespace OC\Files\Cache;
-use Doctrine\DBAL\Exception\RetryableException;
+use OC\DB\Exceptions\DbalException;
use OC\Files\Storage\Wrapper\Encryption;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\Cache\IPropagator;
@@ -136,7 +136,11 @@ class Propagator implements IPropagator {
try {
$builder->executeStatement();
break;
- } catch (RetryableException $e) {
+ } catch (DbalException $e) {
+ if (!$e->isRetryable()) {
+ throw $e;
+ }
+
/** @var LoggerInterface $loggerInterface */
$loggerInterface = \OCP\Server::get(LoggerInterface::class);
$loggerInterface->warning('Retrying propagation query after retryable exception.', [ 'exception' => $e ]);