Skip to content

Conversation

@icewind1991
Copy link
Member

Also log the lock state that causes the conflict when a locking error occurs.

Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label May 4, 2018
@icewind1991 icewind1991 added this to the Nextcloud 14 milestone May 4, 2018
@icewind1991 icewind1991 requested review from MorrisJobke and rullzer May 4, 2018 11:32
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

Tested and works 👍

@MorrisJobke
Copy link
Member

@icewind1991 Could you also add the same stuff for DB based locks?

@MorrisJobke
Copy link
Member

BTW this looks then like this:

{
    "reqId": "HLWWOgSfTJLezqiqgA48",
    "level": 4,
    "time": "2018-05-04T12:22:33+00:00",
    "remoteAddr": "172.20.0.1",
    "user": "admin",
    "app": "webdav",
    "method": "MOVE",
    "url": "/remote.php/dav/uploads/admin/web-file-upload-cdc905d9d8aed4152d0876181bb5212c-1525436523116/.file",
    "message": {
        "Exception": "OCA\\DAV\\Connector\\Sabre\\Exception\\FileLocked",
        "Message": "\"filename.png\" is locked",
        "Code": 0,
        "Trace": [...],
        "File": "/var/www/html/apps/dav/lib/Connector/Sabre/File.php",
        "Line": 201,
        "Previous": {
            "Exception": "OCP\\Lock\\LockedException",
            "Message": "\"filename.png\" is locked",
            "Code": 0,
            "Trace": [...],
            "File": "/var/www/html/lib/private/Files/View.php",
            "Line": 1970,
            "Previous": {
                "Exception": "OCP\\Lock\\LockedException",
                "Message": "\"files/3b3f0e53c6300006db7fe574a649f043\" is locked, existing lock on file: 3 shared locks",
                "Code": 0,
                "Trace": [...],
                "File": "/var/www/html/lib/private/Lock/MemcacheLockingProvider.php",
                "Line": 123
            }
        },
        "CustomMessage": "--"
    },
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1 Safari/605.1.15",
    "version": "14.0.0.2"
}

@MorrisJobke MorrisJobke requested a review from nickvergessen May 7, 2018 13:38
@MorrisJobke MorrisJobke merged commit 7f5567e into master May 7, 2018
@MorrisJobke MorrisJobke deleted the log-lock-state-on-conflict branch May 7, 2018 14:42
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants