How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Open a document (via WOPI).
- Save the document.
- Get the changeLock to fail (somehow!)
- File cannot be saved, even after retrying.
Expected behaviour
In file_put_contents[1] when promoting a lock from SHARED to EXCLUSIVE via changeLock, it might fail. In that case, unlock should be called to release the SHARED lock before returning from file_put_contents.
[1]
|
$this->changeLock($path, ILockingProvider::LOCK_EXCLUSIVE); |
Actual behaviour
When changeLock fails, it throws LockedExceptoin unlock is not called to release the shared lock on the file. Retrying by calling file_put_contents again will never succeed, because each call adds a SHARED lock, and changeLock cannot promote to EXCLUSIVE with more than one SHARED lock.
The file remains locked and saving it never succeeds until the lock expires, or the document is closed (which explicitly releases all locks).
How to use GitHub
Steps to reproduce
Expected behaviour
In file_put_contents[1] when promoting a lock from SHARED to EXCLUSIVE via changeLock, it might fail. In that case, unlock should be called to release the SHARED lock before returning from file_put_contents.
[1]
server/lib/private/Files/View.php
Line 668 in 26fde7a
Actual behaviour
When changeLock fails, it throws LockedExceptoin unlock is not called to release the shared lock on the file. Retrying by calling file_put_contents again will never succeed, because each call adds a SHARED lock, and changeLock cannot promote to EXCLUSIVE with more than one SHARED lock.
The file remains locked and saving it never succeeds until the lock expires, or the document is closed (which explicitly releases all locks).