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

remove unneeded locks in getCacheEntry #9387

Merged
merged 1 commit into from
May 4, 2018
Merged

Conversation

icewind1991
Copy link
Member

Extra locking there isn't needed to ensure a consistent state

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
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

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

A lot better for an upload of a single file.

Before:

acquire shared lock on "files/github.png" on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"
acquire shared lock on "files/github.png" on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"
acquire shared lock on "files/github.png" on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"
acquire shared lock on "files/github.png" on storage "home::admin"
acquire exclusive lock on "files/admin/files/github.png.upload.part" on storage "home::admin"
acquire shared lock on "files/admin" on storage "home::admin"
acquire shared lock on "files/admin/files" on storage "home::admin"
acquire shared lock on "files/github.png" on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"
acquire shared lock on "files/github.png" on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"
change lock on "files/github.png" to exclusive on storage "home::admin"
change lock on "files/github.png" to shared on storage "home::admin"
release exclusive lock on "files/admin/files/github.png.upload.part" on storage "home::admin"
release shared lock on "files/admin" on storage "home::admin"
release shared lock on "files/admin/files" on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"

After:

acquire shared lock on "files/github.png" on storage "home::admin"
change lock on "files/github.png" to exclusive on storage "home::admin"
change lock on "files/github.png" to shared on storage "home::admin"
release shared lock on "files/github.png" on storage "home::admin"

Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

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

Makes sense

@MorrisJobke MorrisJobke merged commit fb29634 into master May 4, 2018
@MorrisJobke MorrisJobke deleted the getcachentry-lock branch May 4, 2018 12:57
@MorrisJobke
Copy link
Member

@icewind1991 Could you please open a backport for this?

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.

3 participants