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

The Flock issue #3757

Closed
kobergj opened this issue May 10, 2022 · 2 comments
Closed

The Flock issue #3757

kobergj opened this issue May 10, 2022 · 2 comments
Assignees
Labels
Priority:p1-urgent Consider a hotfix release with only that fix Type:Bug

Comments

@kobergj
Copy link
Collaborator

kobergj commented May 10, 2022

While writing or reading nodes from the disk we want to avoid inconsistent states. That is why we lock (or readlock) files before writing/reading them. This is done by filelocks package.

This works fairly well, however there is a critical point:
When unlocking the file again, we want to delete the created lockfile. BUT we only want to do this when there are no more locks on the file. This leads to concurrency issues when two routines try to delete the file at the same time.

The critical part of the code is this: https://github.com/cs3org/reva/blob/edge/pkg/storage/utils/filelocks/filelocks.go#L144
We need to find a proper way to delete the lockfile without affecting other go routines.

This bug leads to an error message like:

{
  "error":"remove /var/lib/ocis/storage/users/spacetypes/personal/ddc2004c-0977-11eb-9d3f-a793888cd0f8.flock: no such file or directory",
}

It happens especially often on batch actions (restore, delete, upload, ...).

Whenever you see an error message like above it is most likely this issue that is causing it

@kobergj
Copy link
Collaborator Author

kobergj commented May 10, 2022

cc @dragotin @micbar

@kobergj
Copy link
Collaborator Author

kobergj commented May 11, 2022

Closing this since the supposed fix is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:p1-urgent Consider a hotfix release with only that fix Type:Bug
Projects
Archived in project
Development

No branches or pull requests

2 participants