Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/private/DB/Exceptions/DbalException.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
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;
Expand Down Expand Up @@ -74,6 +75,10 @@ public static function wrap(\Doctrine\DBAL\Exception $original, string $message
);
}

public function isRetryable(): bool {
return $this->original instanceof RetryableException;
}

public function getReason(): ?int {
/**
* Constraint errors
Expand Down
8 changes: 6 additions & 2 deletions lib/private/Files/Cache/Propagator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -136,7 +136,11 @@ public function propagateChange($internalPath, $time, $sizeDifference = 0) {
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 ]);
Expand Down