Skip to content

[stable19] Unlock when promoting to exclusive lock fails - #24076

Merged
juliusknorr merged 1 commit into
stable19from
backport/23741/stable19
Nov 16, 2020
Merged

[stable19] Unlock when promoting to exclusive lock fails#24076
juliusknorr merged 1 commit into
stable19from
backport/23741/stable19

Conversation

@backportbot-nextcloud

Copy link
Copy Markdown

backport of #23741

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>
@nickvergessen
nickvergessen requested review from icewind1991 and removed request for nickvergessenNovember 16, 2020 14:57
@juliusknorr
juliusknorr merged commit 8de8bd2 into stable19Nov 16, 2020
@juliusknorr
juliusknorr deleted the backport/23741/stable19 branch November 16, 2020 16:07
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rullzer@juliusknorr@Ashod