Skip to content

Conversation

@ogoffart
Copy link
Contributor

Will help for owncloud/core#26981

Relates to owncloud/core#26981

We do not track the success or error of the DeleteJob because it does not
matter. If it fails, it might be because the chunks were already removed.
If not, the chunks will be stale, but the server must anyway do a few
cleanup from time to time because we do not always remove the chunks
Stale chunks might be there because a file was removed or would just not
be uploaded, for any reason.
We just start the DeleteJob but we don't care if it success or not.

Relates to owncloud/core#26981

One of the test is testing the case where the file is modified on the server
during the upload. So this test the precondition failed error.
The FakeGetReply logic was modified because resizing a 150MB big QByteArray
by increment of 16k just did not scale when downloading a big file.
 - Test that we recover correctly if the chunks were removed on the server.
 - Test changing the file localy while uploading.
@guruz
Copy link
Contributor

guruz commented Jan 24, 2017

Is this for 2.3?

@guruz
Copy link
Contributor

guruz commented Jan 24, 2017

is this 2.3 material?

Copy link
Member

@jturcotte jturcotte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a nitpick.

// The upload info is stale. remove the stale chunks on the server
_transferId = progressInfo._transferid;
// Fire and forget. Any error will be ignored.
(new DeleteJob(propagator()->account(), chunkUrl(), this))->start();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be a bit cleaner and safer if chunkUrl would take the transferId as parameter (and could be made static) instead of having to set the variable and reset it later.

if (account()->capabilities().chunkingNg()) {
foreach (uint transferId, ids) {
QUrl url = Utility::concatUrlPath(account()->url(), QLatin1String("remote.php/dav/uploads/")
+ account()->davUser() + QLatin1Char('/') + QString::number(transferId));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this use the same chunkUrl implementation?

@jturcotte jturcotte added this to the 2.3.0 milestone Jan 25, 2017
@ogoffart ogoffart merged commit 268fc97 into 2.3 Jan 25, 2017
@ogoffart ogoffart deleted the chunking-ng-cleanup branch January 25, 2017 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants