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

scanFile() does not return file id if scanned file matches cache entry 100% (same mtime) #16659

Closed
PVince81 opened this issue Jun 1, 2015 · 3 comments
Labels

Comments

@PVince81
Copy link
Contributor

PVince81 commented Jun 1, 2015

When scanFile() is called on a file, and that file is already in the cache, it will usually try and see if there are differences and whether the cache needs to be updated.

In case there are no differences (same mtime), scanFile() will return the found data.
However, that data will not contain the file id.

Found while debugging a race condition in a backport's unit test: #16369 (comment)

It is not clear yet whether this could happen on a productive instance, and if it happens whether it will cause strange errors.

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 1, 2015

In that unit test we actually had the following situation:

  1. The folder "files" did not exist on disk
  2. The cache entry for "files" did exist in the cache
  3. setupFS() / getUserFolder() would see that the folder does not exist, so it would create it.
  4. The creation of the folder would trigger scanFile() as if it was a new folder
  5. The scanFile() bug would not return the fileid and cause trouble with subsequent calls of calculateFolderSize()

@PVince81
Copy link
Contributor Author

PVince81 commented Jun 1, 2015

Looks like #10993 would cover this.

@PVince81
Copy link
Contributor Author

PVince81 commented Oct 9, 2015

#10993 was merged, closing

@PVince81 PVince81 closed this as completed Oct 9, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant