Closed Bug 1860020 Opened 2 years ago Closed 2 years ago

Debug builds with telemetry off are unusable

Categories

(Core :: Preferences: Backend, defect)

defect

Tracking

()

RESOLVED FIXED
122 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox118 --- wontfix
firefox119 --- wontfix
firefox120 --- wontfix
firefox121 --- wontfix
firefox122 --- fixed

People

(Reporter: pierov, Assigned: pierov)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

For Tor Browser we disable the telemetry, both at compile time with MOZ_TELEMETRY_REPORTING and at runtime with various preferences (that we also lock, to prevent the code from changing them).

However, when building in debug mode with our configuration, CheckTelemetryPref (introduced with Bug 1444275 from what I can tell) asserts the pref value is the same as TelemetryPrefValue.

This results in at least two kinds of breakage (all tab crashing when the startup page is about:blank or a startup crash in the main process otherwise).

I think this could be avoided by changing the pref value to be false when MOZ_TELEMETRY_REPORTING isn't defined (and possibly not asserting in that case).

Set release status flags based on info from the regressing bug 1444275

Bug 1444275 introduced an assertion on the parent process to check that
the telemetry preference value is as expected.
However, this expected value did not take MOZ_TELEMETRY_REPORTING into
account, therefore it prevented debug builds to work whenever telemetry
was disabled both at build time and with preferences.

Set release status flags based on info from the regressing bug 1444275

The severity field is not set for this bug.
:KrisWright, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(kwright)
Severity: -- → S3
Flags: needinfo?(kwright)

On the review there was a question about the macro I used, but I'm unsure on how to answer.
Should I find also a reviewer from the telemetry group?
Otherwise, could someone please land the patch for me, since I don't have the permissions?
Thanks in advance.

Travis, could you weigh in on the MOZ_TELEMETRY_REPORTING macro in phab, or redirect to someone?

Flags: needinfo?(tlong)

I'm going to defer this to :chutten from my team who I feel would be a more suitable person to answer this question due to his experience with Desktop telemetry.

Flags: needinfo?(tlong) → needinfo?(chutten)

Ugh, not the tangled mess of Telemetry prefs and defines again. Oh well, let's see what we're working with here.

If I understand the complaint properly, the problem is MOZ_ASSERT(NS_SUCCEEDED(Preferences::GetBool(kTelemetryPref, &value)) && value == TelemetryPrefValue());. Given how complicated Telemetry defines are, I'd recommend dealing with this as narrowly as possible. For example:

MOZ_TELEMETRY_REPORTING is not defined for local, unofficial, developer builds which need some parts of the Telemetry system active in order to write and run instrumentation tests. (This is accomplished through having everything besides upload working). This way of working must be preserved.

So what should we do here. Hrm. Well, since non-debug builds are operating fine, the condition that the assert prevents in debug must not be crucial. CheckTelemetryPref is only called in non-Android non-parent processes, and according to the comment, aims to ensure the return value of TelemetryPrefValue() matches what's stored in kTelemetryPref. Wait. But kTelemetryPref is toolkit.telemetry.enabled which "controls a diminishing number of things and is intended to be deprecated, and then removed.". Specifically, it doesn't and hasn't for at least eight years controlled whether Telemetry is on in Firefox Desktop.

(It hearkens from a time when "Telemetry" and "Firefox Health Report (FHR)" were two different systems, which hasn't been true since Fx42 circa 2015).

That this code is in place at all was because it was used to control whether Fennec's (not Fenix's) Telemetry was enabled because Fennec didn't get the Telemetry unification memo because it never had FHR.

This is all to say: I am aware of no situations where CheckTelemetryPref is worth calling: It's checking the value of a pref that's only valid in non-unified Telemetry which hasn't existed in Firefox Desktop for eight years and hasn't existed in Mobile since we moved to Fenix and it's only checking that when not building for Android... it's a perfect storm of being useless. Alas.

Why is it still there? Well, four years ago I had to deprioritize bug 1577863 in favour of other more pressing matters (Project Shredder, Accounts Ecosystem Telemetry, and the protoypes of what became Firefox on Glean and GLAM)

All this is to say that an ideal patch would de-fennec-strate mozilla-central or at least Firefox Desktop Telemetry. But a good-enough patch would be to just remove CheckTelemetryPref entirely.

Does this help?

Flags: needinfo?(chutten)

(In reply to Chris H-C :chutten|PTO (back November 29) from comment #8)

All this is to say that an ideal patch would de-fennec-strate mozilla-central or at least Firefox Desktop Telemetry. But a good-enough patch would be to just remove CheckTelemetryPref entirely.

Does this help?

Yes, thanks!

Should I also remove SetupTelemetryPref? It feels kinda strange it also tries to lock the value.

(Sorry for the delayed response, I'm now back from PTO)

I'd leave SetupTelemetryPref for now as if we remove it we should really consider this a "remove pref toolkit.telemetry.enabled" action and I don't want to think too deeply about that right now. These things tend to spider pretty outrageously, and we probably all have other things we'd rather be doing : )

(In reply to Chris H-C :chutten from comment #10)

(Sorry for the delayed response, I'm now back from PTO)

No problem at all, I saw it but commented anyway before I forgot about it 😄️.

I'd leave SetupTelemetryPref for now as if we remove it we should really consider this a "remove pref toolkit.telemetry.enabled" action and I don't want to think too deeply about that right now. These things tend to spider pretty outrageously, and we probably all have other things we'd rather be doing : )

Works for me, thanks again for your answers 😊️

Attachment #9359318 - Attachment is obsolete: true

Bug 1444275 introduced an assertion on the parent process to check that
the telemetry preference value is as expected.
However, this expected value did not take MOZ_TELEMETRY_REPORTING into
account, therefore it prevented debug builds to work whenever telemetry
was disabled both at build time and with preferences.

Attachment #9366243 - Attachment description: Bug 1860020: Do not assert on telemetry values when MOZ_TELEMETRY_REPORTING is not defined. r?KrisWright,chutten → Bug 1860020 - Remove the assertion on the value of toolkit.telemetry.enabled. r=KrisWright,chutten
Pushed by chutten@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c4d36b144efe Remove the assertion on the value of toolkit.telemetry.enabled. r=KrisWright,chutten
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch

The patch landed in nightly and beta is affected.
:pierov, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox121 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(pierov)
Flags: needinfo?(pierov)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: