aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel <mail@danielkesselberg.de>2024-05-29 14:22:49 +0200
committerGitHub <noreply@github.com>2024-05-29 14:22:49 +0200
commit75ce3b33abb0813cdd05ecb46d83ce629d67bffb (patch)
treea0e3a333d15f307ef34ce86cf2a1d6fb19a7fba7 /lib
parentfca38e12c8fd76be717ad4fe7f1d0eaecfb09288 (diff)
parent3fb0aa40cd0c06d208653d17d62c0ce2b358d6cc (diff)
downloadnextcloud-server-75ce3b33abb0813cdd05ecb46d83ce629d67bffb.tar.gz
nextcloud-server-75ce3b33abb0813cdd05ecb46d83ce629d67bffb.zip
Merge pull request #45559 from nextcloud/bug/noid/add-reason-lock-wait-timeout
add mapping for lock wait timeout
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/Exceptions/DbalException.php4
-rw-r--r--lib/public/DB/Exception.php7
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/DB/Exceptions/DbalException.php b/lib/private/DB/Exceptions/DbalException.php
index 81ee9c62a0f..05ea9e22a5d 100644
--- a/lib/private/DB/Exceptions/DbalException.php
+++ b/lib/private/DB/Exceptions/DbalException.php
@@ -17,6 +17,7 @@ use Doctrine\DBAL\Exception\DriverException;
use Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException;
use Doctrine\DBAL\Exception\InvalidArgumentException;
use Doctrine\DBAL\Exception\InvalidFieldNameException;
+use Doctrine\DBAL\Exception\LockWaitTimeoutException;
use Doctrine\DBAL\Exception\NonUniqueFieldNameException;
use Doctrine\DBAL\Exception\NotNullConstraintViolationException;
use Doctrine\DBAL\Exception\RetryableException;
@@ -82,6 +83,9 @@ class DbalException extends Exception {
/**
* Other server errors
*/
+ if ($this->original instanceof LockWaitTimeoutException) {
+ return parent::REASON_LOCK_WAIT_TIMEOUT;
+ }
if ($this->original instanceof DatabaseObjectExistsException) {
return parent::REASON_DATABASE_OBJECT_EXISTS;
}
diff --git a/lib/public/DB/Exception.php b/lib/public/DB/Exception.php
index 8fef01ca0a4..6b908382aea 100644
--- a/lib/public/DB/Exception.php
+++ b/lib/public/DB/Exception.php
@@ -121,6 +121,13 @@ class Exception extends BaseException {
public const REASON_UNIQUE_CONSTRAINT_VIOLATION = 14;
/**
+ * The lock wait timeout was exceeded
+ *
+ * @since 30.0.0
+ */
+ public const REASON_LOCK_WAIT_TIMEOUT = 15;
+
+ /**
* @return int|null
* @psalm-return Exception::REASON_*
* @since 21.0.0