-
Notifications
You must be signed in to change notification settings - Fork 669
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 upload during finalization #9500
Conversation
TheOneRing
commented
Mar 9, 2022
•
edited
Loading
edited
Client | Server | State |
---|---|---|
A | A | Same version on both sides |
B | A | Versions differ, client starts upload |
B | A | During the upload, B gets locked |
B | B | B is uploaded, Local B is locked so we don't enter the state to the db |
C | B | The local db was not updated, we don't know about B on the server, local file gets updated and becomes C |
C | B | We have C locally and B on the server -> clash |
9c8fce7
to
8b479d5
Compare
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.
This patch means that any call to isFileLocked()
creates a lock on the file, which is released automatically. That function is called often, are you sure there are no side effects?
@@ -319,4 +319,31 @@ Utility::NtfsPermissionLookupRAII::~NtfsPermissionLookupRAII() | |||
qt_ntfs_permission_lookup--; | |||
} | |||
|
|||
|
|||
Utility::Handle::Handle(HANDLE h, std::function<void(HANDLE)> &&close) | |||
: _handle(h) |
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.
is the close function used anywhere so far? If not I'd rather not have it. You're only using the default, right?
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.
In the vfs plugin, the handle class is just moved to the main repo.
We did the same before, just explicitly called CloseHandle before. |
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.
ok
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.
looks reasonable ... but I'm not familiar with this part of the code base
488be63
to
29c5b4e
Compare
Kudos, SonarCloud Quality Gate passed! |