Skip to content
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

Bug 1668820 - Always launch the ping uploader on a background thread #1252

Merged
merged 1 commit into from
Oct 9, 2020

Conversation

badboy
Copy link
Member

@badboy badboy commented Oct 9, 2020

The uploader is always started after pings are already submitted (and assembled).
The ping uploader can potentially block as it uploads several pings and
even goes to sleep if told to wait (soon).
By putting it on a background thread we ensure this doesn't stop any
other work.

This was already manually done in one place, but not in the others.
This should be equivalent to Android's way of pushing this work to a
workmanager job.

Unfortunately this is near impossible to add a test for, as we would somehow need to instruct the uploader to block so that we can encounter the problems. Which we can't.
So we have to live with the existing tests (they pass) & integration tests (on CI).


This should unblock #1240

The uploader is always started after pings are already submitted (and assembled).
The ping uploader can potentially block as it uploads several pings and
even goes to sleep if told to wait (soon).
By putting it on a background thread we ensure this doesn't stop any
other work.

This was already manually done in one place, but not in the others.
This should be equivalent to Android's way of pushing this work to a
workmanager job.

Unfortunately this is near impossible to add a test for,
as we would somehow need to instruct the uploader to block so that we can encounter the problems.
Which we can't.
So we have to live with the existing tests (they pass) & integration tests (on CI).
@badboy badboy requested review from travis79 and brizental October 9, 2020 12:28
@auto-assign auto-assign bot requested a review from mdboom October 9, 2020 12:29
@badboy badboy removed the request for review from mdboom October 9, 2020 12:49
Copy link
Contributor

@brizental brizental 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 to me.

@badboy badboy merged commit e83abba into main Oct 9, 2020
@badboy badboy deleted the ios/async-upload-processing branch October 9, 2020 13:49
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.

3 participants