retry polling requests without proxy
Categories
(Firefox :: Remote Settings Client, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: mixedpuppy, Assigned: robwu)
References
(Blocks 1 open bug)
Details
(Whiteboard: [addons-jira])
Attachments
(2 files, 1 obsolete file)
a bypassProxy flag has been added in https://phabricator.services.mozilla.com/D126550
Remote settings should re-poll if there is a failure, and the request was using a proxy.
Straw man changes
remoteSettings.pollChanges = async ({
expectedTimestamp,
trigger = "manual",
full = false,
bypassProxy = false,
} = {}) => {
and later in that
try {
pollResult = await Utils.fetchLatestChanges(Utils.SERVER_URL, {
expectedTimestamp,
lastEtag,
bypassProxy, // fetchLatestChanges would pass this through to ServiceRequest
});
} catch (e) {
if (!bypassProxy && pollResult.request.channel.proxyInfo) {
remoteSettings.pollChanges(expectedTimestamp, trigger, full, true);
return;
}
// Report polling error to Uptake Telemetry.
let reportStatus;
if (/JSON\.parse/.test(e.message)) {
reportStatus = UptakeTelemetry.STATUS.PARSE_ERROR;
} else if (/content-type/.test(e.message)) {
reportStatus = UptakeTelemetry.STATUS.CONTENT_ERROR;
} else if (/Server/.test(e.message)) {
reportStatus = UptakeTelemetry.STATUS.SERVER_ERROR;
} else if (/Timeout/.test(e.message)) {
reportStatus = UptakeTelemetry.STATUS.TIMEOUT_ERROR;
} else if (/NetworkError/.test(e.message)) {
reportStatus = UptakeTelemetry.STATUS.NETWORK_ERROR;
} else {
reportStatus = UptakeTelemetry.STATUS.UNKNOWN_ERROR;
}
await UptakeTelemetry.report(
TELEMETRY_COMPONENT,
reportStatus,
pollTelemetryArgs
);
// No need to go further.
throw new Error(`Polling for changes failed: ${e.message}.`);
}
Comment 1•3 years ago
|
||
Hi Mathieu, we'd like to target Fx95 for this change, are you ok with that timeline?
Comment 2•3 years ago
|
||
Yes, I assume I will be able to do it. I will start working this week.
Comment 3•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
I'm taking over from Mathieu.
Currently writing unit tests, I may revisit the implementation if it makes sense to do so.
I'll also check a pref, depending on what we do for bug 1734435.
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Telemetry definition and data review is in bug 1733481
Assignee | ||
Comment 7•3 years ago
|
||
The patches here depend on bug 1733481 (for the changes in ServiceRequest.jsm).
To make sure that this patch stack of two only applies if the other patches stick (opposed to being backed out), I've made a change to code that was changed in that other patch: https://phabricator.services.mozilla.com/D129645?vs=on&id=501479#C4438550OL77
The change itself is useful on its own (using internal.bypassProxy = true
instead of internal.bypassProxy = this.bypassProxyEnabled
, because the if-block that contains it already checks the this.bypassProxyEnabled
condition).
Locally, I've verified that the new tests pass on macOS and on Android. The try push is green: https://treeherder.mozilla.org/jobs?repo=try&revision=7276c6021ceaa0e87d04f201788d28668dbaa2c0
So once the second patch has been approved, I'll push it to Lando.
Comment 10•3 years ago
|
||
Backed out 3 changesets (Bug 1732792, Bug 1733481) for causing talos crashes in ConditionVariableImpl and xpcshell failures in test_remote_settings_utils.js.
Backout link: https://hg.mozilla.org/integration/autoland/rev/197af0b52aec261be5f484b48c46c26c8f208ae2
Push with failures, failure log.
Assignee | ||
Comment 11•3 years ago
|
||
The test failures in test_remote_settings_utils.js etc. are because the second patch in this stack calls request.logProxySource
. However, the method is not an instance method but a static method. This is fixed in https://phabricator.services.mozilla.com/D129683?vs=501480&id=501585#toc
I'll check why the Talos tests crash, and if that doesn't have anything to do with the patch stack here, I'll reland everything.
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d1a755a61abf
https://hg.mozilla.org/mozilla-central/rev/6d9a180e160f
Description
•