-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Lock file during download #17009
Lock file during download #17009
Conversation
This will throw a LockedException if a concurrent request is currently touching that file.
This for the download error message part for here #16701 Another alternative would be to just try and lock the file before the upload, and then directly unlock before the transfer starts, or after the first packet. (hacky) |
Looks like max execution time is set to 0 here https://github.com/owncloud/core/blob/master/lib/private/files.php#L151 but it's only for zip files, not regular downloads. |
well - this is what we want to have - right? Don't touch the file while I'm downloading it or I'll get crap.
This is why we need a TTL on locks - as discussed right from the beginning |
we might want to change this and have execution time of 0 for any kind of download. |
} catch (\OCP\Lock\LockedException $ex) { | ||
$l = \OC::$server->getL10N('core'); | ||
$hint = method_exists($ex, 'getHint') ? $ex->getHint() : ''; | ||
\OC_Template::printErrorPage($l->t('File is currently busy, please try again later'), $hint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brrr - this file has to die 💀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need it for zip download... unless we can come up with a WebDAV endpoint for zip download.
Also see #16960 (comment), very hard to decide whether to move forward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need it for zip download... unless we can come up with a WebDAV endpoint for zip download.
we have to do this anyhow from my pov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised zip webdav endpoint here #17014
TTL discussion here: #16966 |
Shouldn't the fopen already handle the locking here? |
Yes, it does. But then it's too late and we already sent the 200 OK + headers. We need to be able to return another HTTP code before fopen (readfile) happens. |
Should we simply disable xsendfile as soon as locking is enabled? |
or drop this feature completely? |
especially thinking about all our wrapper setups I really question if there is a single valid scenario for xsendfile left. |
lets disable it for now if filelocking is active and discuss again for 8.2 |
agreed - I'll add this to this pr ... |
A new inspection was created. |
@owncloud-bot retest this please |
|
Jenkins fails on oracle - can be ignored 👍 |
@th3fallen @icewind1991 please review - thx |
👍 looks good |
Lock file during download
Put a shared lock on a file before download it, and free it at the end of the transfer.
My worries here:
@DeepDiver1975 @icewind1991 what do you think ?
A similar approach will be needed for zip files, see #16960 (comment)