-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Increase chunk size to 1MB #4011
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
Conversation
@nicolas-raoul I tried reproducing the upload error that you were facing but I wasn't able to reproduce it on my device. I tried the following:
However, while testing I noticed a couple of things and have made changes accordingly.
cc @misaochan |
Also, @nicolas-raoul it would be great if you could test this PR can report any upload failures. |
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 just uploaded 3 pictures at the same time (not a set, one by one, in slow mode my Internet is so slow that I have time to enter metadata for 3 pictures while the first is still uploading).
All succeeded, which is great!
Ah, I misunderstood the purpose of the PR. |
Codecov Report
@@ Coverage Diff @@
## master #4011 +/- ##
============================================
- Coverage 10.50% 10.49% -0.01%
Complexity 466 466
============================================
Files 335 335
Lines 12663 12674 +11
Branches 991 991
============================================
Hits 1330 1330
- Misses 11266 11277 +11
Partials 67 67
Continue to review full report at Codecov.
|
Hi @nicolas-raoul , just confirming that sets work for you now? I did see your comments on the issue thread, but those seemed to be describing single uploads? |
Hi @maskaravivek , I just tested this on a Samsung Galaxy S20FE running Android 10. Prior to this PR, pausing and resuming worked quite smoothly for me, but currently it seems to be delayed/buggy (I don't think it is a device issue as the specs are pretty high). I made a GIF of the process (sorry for the bad framerate and resolution, had to work around github's upload limit, I can email you the original if you want):
On the bright side the uploads were successful. :) I did get one failed upload at first but I was tapping pause/resume far too much, it was probably an edge case. Also, I guess once Nicolas confirms no more failures with sets, we should probably turn HTTP logging back off? |
I uploaded a 5-set on a slow Internet connection, and all pics succeeded except one (I sent a log), which is much better than what I was experiencing on the |
Thank you @misaochan and @nicolas-raoul for testing the PR. @nicolas-raoul I see that the server returned a timeout for one of the API calls. The upload should succeed on retrying.
When the pause is clicked, any chunk after the current chunk is not uploaded. The ongoing chunk will continue to upload. For eg if the file was split into 11 parts and the 5th part is getting upload currently, then on clicking pause part 6 onwards won't be uploaded. Earlier it was working smoothly as the file was split into chunks of 256kb each but the issue with such a small size is that it leads to more number of chunks for a single file. So the chances of failure are higher. In this PR I had increased chunk size to 1 MB. So for eg, a file of 4.5 MB will be split into 5 parts instead of 18 parts. As a compromise, I have set the chunk size to 512 KB for now. There would be a latency but it would be lesser than the current latency.
This is because of what I explained above. Also, I am assuming that in general people might be pausing/resuming very frequently. For the above 2 points, I can add a toast to reassure the user that the upload is being paused. |
Yes, I also notice the leaks but most of the leaks seem to be from |
Thanks @nicolas-raoul and @maskaravivek ! The chunk size sounds like a dilemma indeed. Yes, let's try 512 KB for now - if there are upload failures again we can increase to 1 MB again I guess, since that takes precedence over the latency.
That would be great. Let's get one for "Upload paused" and another for "Upload resumed", and then I can merge. :) |
@misaochan I have made the changes. I have used "Pausing uploads..." and "Resuming uploads..." so that the user gets an indication that the action might take a couple of seconds. |
Makes sense. Thanks @maskaravivek ! :) |
Fixes #3992