-
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
It's impossible to delete file while it's being synced #21574
Comments
@icewind1991 Locking doing silly things? Is there any way we can forcefully terminate downloads of files if they are about to be deleted, or is that a Very Bad Thing ™️ ? |
Well this is exactly why we have file locking. To make sure that only 1 instance at a time can do destructive behavour. We make sure all the locks are in place before we start doing stuff and release after. Thus terminating will probably be hell to do. |
The same thing should happend, if an formerly offline client starts syncing, only few second before I have started to delete files. To save bandwidth and give the owner of files the possibility to correct things, maybe he uploaded the wrong file. So I appreciate giving "delete" higher priority than "sync". |
This is expected behavior due to file locking. @icewind1991 what do you think of the suggestion regarding priority ? |
It is not a matter of priority it is a matter of independent processes. If 1 process in chaning the file (and has it locked) and another php process wants to delete we have no way of signaling the chaning process to stop. A lot of operating systems also do not allow this. And I do not really see a way to cleanly signal other processes in a clean way right now... |
I agree that this is expected behavior and not something we can solve without a lot more work in locking |
The only thing that could be done somehow within the current architecture is to add a small waiting delay if a file is locked. The delay must still have a timeout after a few seconds. The old file locking had something like this: https://github.com/owncloud/files_locking/blob/master/lib/lock.php#L105 This could increase the change of a deletion to succeed. The problem here though is that the PHP request might time out, and then either get killed (when using php5-fpm) or it will continue but the client will believe that it failed. |
@DeepDiver1975 @karlitschek see previous comment about lock wait with |
Not sure about severity. So far this is by design, but it would be a nice improvement that could reduce the likeliness of a bad UX in the case someone wants to delete locked files in the web UI. |
Agreed. Good idea @PVince81 |
Since we're past feature freeze, adding this logic right now would be a bit risky. We also might want to evaluate whether the waiting should be done for all operations or only a few like deletions. @cmonteroluque |
While it's impossible to delete this file immediately it should be possible to rename/move it. Then why do not move this file to an invisible folder for trash with some unique name? |
Rename is not possible either. This is unlike the linux filesystem where a file being written to can be moved while another process still has it open. This won't work with external storages. Also the file cache and other processes might have trouble too if we're moving the file in the middle of an operation. |
Somewhat related to async file operations: #24509 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Steps to reproduce
Expected behaviour
The file has been deleted. The sync has been interrupted.
Actual behaviour
It's impossible to delete file while it's being synced.
There is message: "Could not delete: "
Server configuration
Operating system:
FreeBSD 10.2
Web server:
nginx-1.8.0
Database:
MariaDB-10.0.23
PHP version:
PHP-5.6.16
ownCloud version: (see ownCloud admin page)
ownCloud-8.2.2
Updated from an older ownCloud or fresh install:
Fresh install.
List of activated apps:
The content of config/config.php:
Are you using external storage, if yes which one: local/smb/sftp/...
NO
Are you using encryption: yes/no
NO
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
NO
Client configuration
Browser:
Firefox-43.0.4
Operating system:
Mac OS X 10.11.2
The text was updated successfully, but these errors were encountered: