]> source.dussan.org Git - nextcloud-server.git/commit
Unlock when promoting to exclusive lock fails 23995/head
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>
Wed, 28 Oct 2020 02:57:24 +0000 (22:57 -0400)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 9 Nov 2020 10:03:15 +0000 (10:03 +0000)
commit7298d037b2a37455cdfb87dac3158981b90f103d
treed33d916cbdd7df0f2af1f2772d06689fc818cf96
parent20885847c849fbfde899e1281d2b820becbab3d8
Unlock when promoting to exclusive lock fails

In certain cases changeLock to EXCLUSIVE fails
and throws LockedException. This leaves the
file locked as SHARED in file_put_contents,
which prevents retrying (because on second
call file_put_contents takes another SHARED
lock on the same file, and changeLock doesn't
allow more than a single SHARED lock to promote
to EXCLUSIVE).

To avoid this case, we catch the LockedException
and unlock before re-throwing.

Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
lib/private/Files/View.php