mirror of
https://github.com/floccusaddon/floccus.git
synced 2026-04-26 14:45:59 +03:00
[GH-ISSUE #1087] Race condition when acquiring lock for webdav based accounts #720
Labels
No labels
browser-specific
bug
correctness issues
enhancement
feature: Google Drive
feature: Linkwarden
feature: git
feature: nextcloud-bookmarks
feature: tabs
feature: webdav
help wanted
native-app
priority: high
priority: low
priority: medium
pull-request
question
question
stale
upstream
waiting for more information
wontfix
🙁 Not following issue template
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/floccus#720
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @raslop on GitHub (Mar 22, 2022).
Original GitHub issue: https://github.com/floccusaddon/floccus/issues/1087
Which version of floccus are you using?
4.12.0
Sync method
{"label"=>"WebDAV"}
Which browser are you using?
Firefox 98.0.1
Which version of Nextcloud Bookmarks are you using? (if relevant)
No response
Which version of Nextcloud? (if relevant)
No response
What kind of WebDAV server are you using? (if relevant)
Doesn't matter.
Describe the Bug
A typical sync cycle looks like this in the logfile of a webdav server:
The first
GETrequest for the.lockfile seems too check if that account is currently locked and the followingPUTseems to actually lock the account, it it was unlocked (404 response).There is a race condition (here approx. 150ms). When a second client does the same
GETfor checking for the.lockfile before thePUTfor the.lockfile of the first client both think nothing is locked and do the.lockfilePUT. If both have changes, the slower one will win, as thisPUTfor the data request happens later and will overwrite the changes of the faster client.To solve this the
GETandPUTfor the.lockfile must be done atomically. WebDAV has theLOCKmethod,) which, if used, should solve the issue, right?Expected Behavior
No race condition.
To Reproduce
Didn't try to reproduce, just thought about it so far.
Debug log provided