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

Add maximum number of retries to PingUploadWorker #953

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

brizental
Copy link
Contributor

@brizental brizental commented Jun 9, 2020

Fixes Bug 1644290

This is a temporary fix so we can stop this issue.

I opened a bug to move this retrying logic to the Rust side: https://bugzilla.mozilla.org/show_bug.cgi?id=1644364

@brizental brizental requested a review from badboy June 9, 2020 08:55
}
PingUploadTask.Wait -> return Result.retry()
PingUploadTask.Done -> return Result.success()
}
} while (true)
} while (uploadFailures < MAX_RETRIES)
return Result.failure()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unsure if this should really be a failure or a retry.

Copy link
Member

Choose a reason for hiding this comment

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

We use a OneTimeWorkRequest which defaults to exponential backoff on retry.
I think failure is the right thing here. If we fail too often, we don't want to reschedule it at all. When a ping gets submitted again (e.g. next time the app is backgrounded) any pending pings are picked up again anyway.

Copy link
Member

Choose a reason for hiding this comment

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

cc @Dexterp37 just for a quick look

Copy link
Contributor

Choose a reason for hiding this comment

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

Works for me, assuming failure doesn't mean deleting the pings

Copy link
Member

Choose a reason for hiding this comment

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

Nope, it's only marking the worker as failed. The pings are handled inside glean-core and will be retried by the next worker.

Copy link
Member

@badboy badboy left a comment

Choose a reason for hiding this comment

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

Code wise good to go, let's double check with @Dexterp37 quickly.
We should also land this in the iOS part, as that's deployed in Firefox for iOS.

Once that's done we should release.

@mdboom
Copy link
Contributor

mdboom commented Jun 9, 2020

Should we file a follow up bug for Swift and Python?

@brizental
Copy link
Contributor Author

Should we file a follow up bug for Swift and Python?

https://bugzilla.mozilla.org/show_bug.cgi?id=1644419

@brizental brizental merged commit 262d658 into mozilla:master Jun 9, 2020
@brizental brizental deleted the 1644290 branch June 9, 2020 15:16
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