-
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
Upload: asynchronious operations #6614
Conversation
(WIP) |
builds from this PR: |
@jnweiger btw next time better build with branch name in file name:) |
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.
If this is merged for 2.5.1 it should be in disabled state. (OC-LazyOps=false
? env variable toggle?) There are some good tests but this is too much for a patch release imo.
@@ -1029,6 +1029,7 @@ void CleanupPollsJob::slotPollFinished() | |||
deleteLater(); | |||
return; | |||
} | |||
_journal->setUploadInfo(job->_item->_file, SyncJournalDb::UploadInfo()); |
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.
Can PollJobs have a "there was an error, don't retry" result in any way? I'm just wondering that no other branch wipes the uploadinfo.
PollJob seems to wipe the pollinfo on non-fatal non-503
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.
Speaking of PollInfo
: It's set on startPollJob
but only removed in this specific error case. And then when a sync is started, PollJobs are rerun? That means polls run indefinitely and block further syncs as long as the server replies "init" or "started"?
I think the idea is that we can continue polling for completion in case the user aborts the sync? (I think you tested that abort()
case in the unittest, excellent!) PollInfos need more documentation about their purpose.
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 case of error, the uploadinfo has to stay so the next sync will deal with it by retrying the final move, or use the upload info to resolve possible conflict, should the file have been updated after all (using checksum)
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.
Yes, a server never finishing that always reply "started" will block the sync forever.
Do you think this is a problem?
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.
UploadInfo not being wiped on failure: So if the server wants to communicate "something failed permanently, stop polling", the poll job would fail, we'd try to resend the final MOVE during the next sync and there it'd fail. Alright, that works.
Infinite polling if server replies that way: Should be ok, would be a significant server bug if that happens and working around it is complicated.
test/testasyncop.cpp
Outdated
}); | ||
|
||
|
||
auto successCallbak = [](TestCase *tc, const QNetworkRequest &request) { |
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.
minor: Callback; decide whether CallBack or Callback
return; | ||
} | ||
_finished = true; | ||
startPollJob(path); |
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.
How does the overall sync timeout work in the presence of polls?
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.
The timeouts are per jobs. A particular PollJob will timeout after the normal timeout time if there is not traffic on that connection. In this case, it will be re-tried again until it succeed.
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.
I meant to confirm that if the server needs 30 minutes to finish the upload then the sync will only finish once that last poll is done. (as it should be for 2.5.1)
note: there's a capability so if you deem suitable, the client could decide to enable the feature if the server does: https://github.com/owncloud/core/pull/32414/files#diff-920833889854d937ebeda804d3eb5b19R52 currently what's in 10.0.10 is in tech preview / alpha stage |
My current understanding is that this feature is enabled at the server's discretion in the first place: It looks like the client announces its capability to the server with the header, and then it either replies with the poll url or does a synchonous action. The concern about having it default to off for the patch release is about potential bugs in the client implementation. In addition there could be a way of switching this feature off in case bugs are discovered in the server implementation. |
@ckamm: I've updated the commit: Added comments, and disabled the behavior by default unless setting the env variable @DeepDiver1975 or @PVince81 : How long does the poll url stay valid, after it once succeed. Imagine this scenario:
Also note that the client will set the OC-LazyOps header for all uploads (non-chunking PUT or chunking MOVE). |
minor: commit message says "assynchronious", should be "asynchronous" |
I'm actually fine with having this in 2.5.1 if we enable this feature only by capability. (We kind-of tested this in the wild with a previous customer when it was called asynchronous PUT with poll jobs). In the server it's disabled by default in config.sample.php so brave server deployers need to enable it anyway in server? if @ckamm @ogoffart agree please change milestone. @PVince81 @ogoffart Can we still get answers to the questions above. #6614 (comment) |
I think the server is not smart and always go to lazy mode when requested. Not sure how long the poll URL is available, @DeepDiver1975 ? |
This was not required with 2.5 because a size of 0 was ignorted when comparing size by the csync updater, to be compatible with very old version of the database. But the we discovery will still think the file is changed if the database contains a size of 0
Rebased and fixed for 2.6 |
Implements owncloud/core#31851