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

File locking on Linux #8316

Open
jnweiger opened this issue Dec 21, 2020 · 7 comments
Open

File locking on Linux #8316

jnweiger opened this issue Dec 21, 2020 · 7 comments

Comments

@jnweiger
Copy link
Contributor

jnweiger commented Dec 21, 2020

Test on Win10 Pro 20H2
https://download.owncloud.com/desktop/ownCloud/testing/2.7.4-rc1.2909/win/ownCloud-2.7.4-rc1.2909.x64.msi
https://download.owncloud.com/desktop/testpilotcloud/testing/2.7.4-rc1.2910/linux/download/

  1. create an empty office document xxx.odt on demo.owncloud.org
  2. connect client 2.7.4 wait for sync to finish, click open xxx.odt
  3. connect windows client and wait for sync to finish, click open xxx.odt there too.
  4. on Linux write "Greetings from Linux" and save.
  5. watch activity in both clients: Linux uploads, windows downloads. OK
  6. on windoes write "Greetings from Windows" and save.
  7. watch activity in both clients: windows uploads, Linux downloads. BAD
  8. The "Greetings from Linux" version is no lost. BAD

Expected behaviour: a conflict is detected. Either in the office suite or in the destop client.

  • add some more text on the Linux side and try save. A conflict requester comes up. GOOD.
  • LibreOffice on Linux did not overwrite the changes made in Windows.

I understand that these are features of the respective office suites.
The client should also be able to report remote edits being overwritten by a local save (and e.g. offer a backup)

@jnweiger jnweiger mentioned this issue Dec 21, 2020
63 tasks
@TheOneRing
Copy link
Member

So the issue here is that the linux client does not lock the file?

@TheOneRing
Copy link
Member

@dragotin Afaik it only works on Windows due to the native file locking, anything we can do on linux?

@TheOneRing TheOneRing changed the title [QA] Win10: office does not report changed dcument when updated from the server [QA] File locking on Linux Jan 13, 2021
@TheOneRing TheOneRing changed the title [QA] File locking on Linux File locking on Linux Jan 13, 2021
@TheOneRing
Copy link
Member

The current implementation does not support file locking.
What happens here is:

  • A opens file, state 1
  • B opens file, state 1
  • B saves file, state 2
  • A syncs file, but the editor still displays the old state
  • A saves files, state 3
  • A syncs file, state 3
  • B syncs file, state 3
    So we can't detect a conflict here.

Server side locking could help here but it would be a very long way to go.
Afaik libreoffice creates .~lock_something files close to the edited file, we could support such lock files for certain applications.

@michaelstingl

@michaelstingl
Copy link
Contributor

we could support such lock files for certain applications.

@michaelstingl

currently not on the roadmap

2 ideas to check in the future…

  • Manual Server-/WebDAV Locking
  • Some magic with future VFS implementations

@fmoc fmoc added the Linux label Apr 14, 2021
@fmoc
Copy link
Contributor

fmoc commented Apr 22, 2021

Possibly related to #7077.

There is some file locking on Linux that also works reasonably well, however it requires the client applications to cooperate. LibreOffice doesn't seem to implement either of the three options for locking, but implements this custom "lock file" approach.

I think the only way out is to implement something like Windows's "let's lock every file by default" approach on Linux. To do that, we'd have to ship our own file system (possibly using FUSE) that implements the locking in its open(...) handler, and either delay or reject calls until the current fd is closed. However, that's going to be quite some work to implement.

Any form of server-side conflict resolving would be a lot better. Having the server decide which upload to use and which one to write as a conflict file would solve the problem. However, then you'll likely have more than one conflict file to store on the server as well.

I guess the cleanest solution (as in, guaranteed to work) would be to synchronize accesses or at least writes to files through the server, like it's done on any proper distributed file system... using a consensus algorithm seems inappropriate, since there is a server, after all.

@jnweiger

This comment was marked as off-topic.

@jnweiger

This comment was marked as off-topic.

@TheOneRing TheOneRing added this to the inbox milestone Apr 20, 2023
@TheOneRing TheOneRing reopened this Apr 21, 2023
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

4 participants