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

[Experimental files locking] Desktop client doesn't lock folders. #3338

Closed
SergioBertolinSG opened this issue Jun 12, 2015 · 6 comments
Closed

Comments

@SergioBertolinSG
Copy link

When using a server with experimental files locking feature (8.1), desktop client can't lock the folders (I was using 1.8.1 version)
Probably this is caused by chunking and a new lock appears every chunk is detected.

Failing case:

Steps to reproduce:

Having experimental files locking enabled:

  1. Upload big files into a folder 'folder' using desktop client.
  2. Rename 'folder' using cadaver(webdav) to 'renamed_folder'

Expected behaviour:
Folder can't be renamed.

Observed behaviour:
Folder is renamed and upload fails.

Usind redis-cli and monitor I can see lots of hashes like this while uploading a big file:
'''
"SETNX" "30a582299ecf116f79b08582ebe7cc14/lockfiles/41b8aaca4e1e560965d02bbc42f5aac2_lock" "true"
1434113889.789006 [0 [::1]:46525] "GET" "30a582299ecf116f79b08582ebe7cc14/lockfiles/41b8aaca4e1e560965d02bbc42f5aac2"
1434113889.789219 [0 [::1]:46525] "SET" "30a582299ecf116f79b08582ebe7cc14/lockfiles/41b8aaca4e1e560965d02bbc42f5aac2" "0"
1434113889.789432 [0 [::1]:46525] "DEL" "30a582299ecf116f79b08582ebe7cc14/lockfiles/41b8aaca4e1e560965d02bbc42f5aac2_lock"
'''

Suggestions?
@dragotin @PVince81 @icewind1991

@PVince81
Copy link
Contributor

Probably this is caused by chunking and a new lock appears every chunk is detected.

Uploading every chunk should not trigger any locking.
It's only once the final file is getting assembled into a part file that the part file gets locked (prevents rename of parent dir).
Then the part file gets renamed to final file, which locks the part file + final file.

@PVince81
Copy link
Contributor

To solve this we'd need to lock the final file (or part file) at the beginning of the transfer.
Then the lock might stay alive forever if no more chunks arrive, would need some kind of timeout.

The current locking implementation does not support having cross-PHP-process locking. The locks are cleared as soon as the PHP request finishes.

So something to think about for later probably, tweaking the locking implementation.

@PVince81
Copy link
Contributor

CC @DeepDiver1975

@Dianafg76
Copy link

Probably related to #3366

@SergioBertolinSG
Copy link
Author

PR related owncloud/core#17104

@Dianafg76
Copy link

related to #3387
Closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants