Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use isRetryable to catch retryable exceptions #45768

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Conversation

artonge
Copy link
Contributor

@artonge artonge commented Jun 10, 2024

I probably tested before switching to the non deprecated method executeStatement.
This method wraps the exception in a DbalException which provides the handy isRetryable method.

@artonge artonge added bug 3. to review Waiting for reviews feature: files php Pull requests that update Php code labels Jun 10, 2024
@artonge artonge added this to the Nextcloud 30 milestone Jun 10, 2024
@artonge artonge requested a review from mgallien June 10, 2024 16:03
@artonge artonge self-assigned this Jun 10, 2024
@artonge artonge force-pushed the artonge/fix/copy_retry branch 2 times, most recently from ca56968 to 0270aad Compare June 11, 2024 11:13
Signed-off-by: Louis Chemineau <louis@chmn.me>
Copy link
Contributor

@mgallien mgallien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not work
exception below

{
  "reqId": "NUQ2oEs9xatUlVpYSuAD",
  "level": 3,
  "time": "2024-06-11T16:15:44+00:00",
  "remoteAddr": "192.168.21.4",
  "user": "john",
  "app": "webdav",
  "method": "MOVE",
  "url": "/remote.php/dav/trashbin/john/trash/bigFolder3.d1718122530",
  "message": "An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction",
  "version": "26.0.13",
  "exception": {
    "Exception": "Doctrine\\DBAL\\Exception\\DeadlockException",
    "Message": "An exception occurred while executing a query: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction",
    "Code": 1213,
    "Trace": [
      {
        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
        "line": 1814,
        "function": "convert",
        "class": "Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter",
        "type": "->",
        "args": [
          [
            "Doctrine\\DBAL\\Driver\\PDO\\Exception"
          ],
          [
            "Doctrine\\DBAL\\Query"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
        "line": 1749,
        "function": "handleDriverException",
        "class": "Doctrine\\DBAL\\Connection",
        "type": "->",
        "args": [
          [
            "Doctrine\\DBAL\\Driver\\PDO\\Exception"
          ],
          [
            "Doctrine\\DBAL\\Query"
          ]
        ]
      },
      {
        "file": "/var/www/html/3rdparty/doctrine/dbal/src/Connection.php",
        "line": 1163,
        "function": "convertExceptionDuringQuery",
        "class": "Doctrine\\DBAL\\Connection",
        "type": "->",
        "args": [
          [
            "Doctrine\\DBAL\\Driver\\PDO\\Exception"
          ],
          "UPDATE `oc_filecache` SET `storage` = ?, `path_hash` = MD5(CONCAT(?, SUBSTR(`path`, ?))), `path` = CONCAT(?, SUBSTR(`path`, ?)) WHERE (`storage` = ?) AND (`path` LIKE ?)",
          [
            3,
            "files/bigFolder3",
            44,
            "files/bigFolder3",
            44,
            3,
            "files\\_trashbin/files/bigFolder3.d1718122530/%"
          ],
          [
            1,
            2,
            1,
            2,
            1,
            1,
            2
          ]
        ]
      },
      {
        "file": "/var/www/html/lib/private/DB/Connection.php",
        "line": 295,
        "function": "executeStatement",
        "class": "Doctrine\\DBAL\\Connection",
        "type": "->",
        "args": [
          "UPDATE `oc_filecache` SET `storage` = ?, `path_hash` = MD5(CONCAT(?, SUBSTR(`path`, ?))), `path` = CONCAT(?, SUBSTR(`path`, ?)) WHERE (`storage` = ?) AND (`path` LIKE ?)",
          [
            3,
            "files/bigFolder3",
            44,
            "files/bigFolder3",
            44,
            3,
            "files\\_trashbin/files/bigFolder3.d1718122530/%"
          ],
          [
            1,
            2,
            1,
            2,
            1,
            1,
            2
          ]
        ]
      },

@artonge
Copy link
Contributor Author

artonge commented Jun 11, 2024

does not work

Are you sure? I can reproduce consistently without the PR, and I hardly get a failure with it.

Copy link
Contributor

@mgallien mgallien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works fine
I was wrong since I still had changes from #45761
thanks

@artonge
Copy link
Contributor Author

artonge commented Jun 12, 2024

/backport to stable29

@artonge
Copy link
Contributor Author

artonge commented Jun 12, 2024

/backport to stable28

@artonge
Copy link
Contributor Author

artonge commented Jun 12, 2024

/backport to stable27

@artonge
Copy link
Contributor Author

artonge commented Jun 12, 2024

/backport to stable26

@blizzz blizzz mentioned this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug feature: files php Pull requests that update Php code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants