Skip to content
Commit a66fb45c authored by Ashod Nakashian's avatar Ashod Nakashian
Browse files

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: default avatarAshod Nakashian <ashod.nakashian@collabora.co.uk>
parent cad2369e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment