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

Get filesize() if file_exists() #28768

Merged
merged 3 commits into from
Oct 18, 2021
Merged

Get filesize() if file_exists() #28768

merged 3 commits into from
Oct 18, 2021

Conversation

solracsf
Copy link
Member

@solracsf solracsf commented Sep 9, 2021

Should make sense.

Fix #28717

@solracsf solracsf added 3. to review Waiting for reviews backport-request labels Sep 9, 2021
@szaimen szaimen added this to the Nextcloud 23 milestone Sep 9, 2021
@szaimen szaimen requested review from a team, icewind1991, blizzz and juliusknorr and removed request for a team September 9, 2021 10:27
@solracsf solracsf added 2. developing Work in progress 3. to review Waiting for reviews and removed 3. to review Waiting for reviews 2. developing Work in progress labels Sep 9, 2021
@solracsf
Copy link
Member Author

solracsf commented Sep 9, 2021

/backport to stable22

@solracsf
Copy link
Member Author

solracsf commented Sep 9, 2021

/backport to stable21

@solracsf
Copy link
Member Author

solracsf commented Sep 9, 2021

/backport to stable20

@juliusknorr
Copy link
Member

Seems a bit more like hiding the symptoms, do you have any idea why the files are present in the getDirectoryContent call but not when checking the filesize afterwards?

$files = $view->getDirectoryContent($dir);

@solracsf

This comment has been minimized.

@BJORNMIKKELSEN

This comment has been minimized.

@solracsf

This comment has been minimized.

@solracsf
Copy link
Member Author

solracsf commented Oct 1, 2021

do you have any idea why the files are present in the getDirectoryContent call but not when checking the filesize afterwards?

@juliushaertl i've possibly found the root cause; files are on a NFSv4 link, not a very fast one.

2 servers are running in front of it, production with Apache + PHP, and a spare, with PHP + MySQL + Redis. NFS is mounted on both servers, but cronjobs are run from the second (spare) server; so this might be the cause of this race condition?

Nevertheless, this fixes those errors.

@solracsf

This comment has been minimized.

@skjnldsv skjnldsv mentioned this pull request Oct 13, 2021
@skjnldsv skjnldsv merged commit a1c8b6e into master Oct 18, 2021
@skjnldsv skjnldsv deleted the check-file-exists branch October 18, 2021 07:54
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish
Projects
None yet
Development

Successfully merging this pull request may close these issues.

files_versions expiration job trying to read filesize of (already) deleted files
7 participants