Closed Bug 1168890 Opened 9 years ago Closed 9 years ago

Handle X-Weave-Backoff

Categories

(Firefox for iOS :: Sync, defect)

All
iOS 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: rnewman, Assigned: rnewman)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

47 bytes, text/x-github-pull-request
nalexander
: review+
Details | Review
We want to handle protocol-level backoffs, of course.

In the course of implementing timed syncs (Bug 1168501), though, we also need to make sure that we don't repeatedly hammer a user's battery life and data allowance by failing over and over.
Depends on: 1168892
Blocks: 1170367
Summary: Handle X-Weave-Backoff and failure-driven backoff → Handle X-Weave-Backoff
Attached file Pull req.
This puts backoff handling inside the storage client, using a state hook to persist into prefs.

This is much, much simpler than inspecting the response in each synchronizer.

There are two ways we can get a backoff: inside a success response, or as part of a failure response.

The latter still fails. The former still succeeds. But in the former case, the *next* request will now fail due to outstanding backoff. Which is exactly what we want to happen.

We also check for outstanding backoffs, via the storage client itself, when starting to sync each synchronizer -- better then than having the first request fail.

Tested manually by forcibly returning backoff values in updateBackoffFromResponse.

(I really, really want to get a testing service into the tree so we can write some proper tests for this, but alas now is not the time.)
Attachment #8613851 - Flags: review?(nalexander)
Comment on attachment 8613851 [details] [review]
Pull req.

I gave this a quick scan only, but it looks sensible.

Consider not hard-coding the string ("backoff.server...") and varying the Prefs object.  That's a surprising pattern, I think.  I think fixing the Prefs and varying the string is more expected.  (Consider we might want this for FxA and token server, etc.)
Attachment #8613851 - Flags: review?(nalexander) → review+
Legit point. Will do.
Piss, I think I forgot to do the prefs object change. Will file a follow-up.

https://github.com/mozilla/firefox-ios/commit/51cd63aab90f6c063f1c4909b419c2b9798247a6
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Blocks: 1171144
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: