Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup locks in scanner on error #9395

Merged
merged 1 commit into from
May 23, 2018
Merged

Conversation

icewind1991
Copy link
Member

Found while investigating other lock issues

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 rullzer and MorrisJobke May 4, 2018 16:06
} finally {
if ($lock) {
if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) {
$this->storage->releaseLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider);
Copy link
Member

Choose a reason for hiding this comment

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

makes php EA go mimimi,

Unhandled exception in finally causes unexpected behaviour in various php versions,

whatever that means

Copy link
Member

Choose a reason for hiding this comment

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

Seems to work on the versions we support: https://3v4l.org/cG66R

And it is better than nowadays - so go for this way.

@MorrisJobke MorrisJobke merged commit 6b6d522 into master May 23, 2018
@MorrisJobke MorrisJobke deleted the scanner-error-lock-cleanup branch May 23, 2018 18:05
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