Open Bug 1605020 Opened 5 years ago Updated 2 years ago

DoH Rollout Extension: Do not run heuristics on network change if network ID is unchanged

Categories

(Firefox :: Security, enhancement, P3)

Desktop
Unspecified
enhancement

Tracking

()

People

(Reporter: mcrawford, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [trr])

Attachments

(1 obsolete file)

Ported from GitHub issue #145

Summary:

We should remember the network ID, and on connection change, check to see if the current network ID is different from the previous one, and only run heuristics if they are.

Exception: when network id is empty, we always run heuristics, because it could be the case when platform fails to reliably calculate a network id.

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

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

IIUC, the patch in bug 1600109 doesn't address this issue.

Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Priority: -- → P2
Version: 73 Branch → Trunk

We want to cache heuristic results based on networkID
A short logic would be:

  • check if network id is in cache
  • if it is, use the heuristic results to set trr mode and trigger heuristics to update cache.
  • if it is not wait for heuristics to complete.
Assignee: nobody → valentin.gosu

This adds a simple in memory cache for the result of runHeuristics.
The added benefit is that we are able to immediately go to the
required TRR mode, without waiting for all the heuristics to complete.

While looking at bug 1626083, I explored the network id caching idea a bit to see if I could come up with something that would help with throttling telemetry event volume on volatile networks. I made this flow diagram, thought I'd leave it here in case it ever ends up being useful.

                                        ┌──────────────┐                         ┌───────────────┐
                                        │              │                         │ network down  │
                                        │  network up  │                         └────────┬──────┘
                                        │              │                                  │
                                        └──┬───────────┴────────────┐          ┌──────────▼───────────────┐
                                           │                        │          │ reset all waiting/timers │
                                           │                        │          └──────────────────────────┘
                                           │                        │
                     ┌─────────────────────▼──────┐                 │
                     │                            │         ┌───────▼──────────────┐
                     │captive portal connectivity ◄─────┐   │ network id available │
                     │                            │     │   └──────┬───────────────┘
                     └────────────┬───────────────┘     │          │
                                  │                     │          │
                       ┌──────────▼─────────────┐       │   ┌──────▼────────────────────┐     ┌────────┐
                       │waiting for connectivity│       │   │ cached result available?  ├────►│ use it │
                       │from network id branch? │       │   └────────┬──────────────────┘     └────────┘
                       └──────────┬─────────────┘       │            │
                                  │                     │            │ no
                                  │                     │       ┌────▼──────────────────────────┐
                                  │yes                  │       │captive portal service enabled?│
┌────────────────────────┐        │                     │       └────┬──────────────────────────┘
│   Assumption:          │        │                     │            │ yes
│  networkID will always │        │                     │      ┌─────▼─────────────────┐
│  become available on   │        │                     │      │ connectivity already? │
│  every network         │        │                     │      └────┬────────┬─────────┘
└────────────────────────┘        │                  ┌──┴───┐       │        │
                                  │                  │ wait ◄───no──┘        │
                                  │                  └──────┘                │
                                  │                                          │yes
                                  │                                          │
                                  │                                          │
                                  │        ┌────────────────┐                │
                                  └────────► run heuristics ◄────────────────┘
                                           └────────┬───────┘
                                                    │
                                                    │
                                     ┌──────────────▼──────────────────┐
                                     │update cache & record telemetry  │
                                     └─────────────────────────────────┘

Not actively working on this.

Assignee: valentin.gosu → nobody
Status: REOPENED → NEW
Assignee: nobody → valentin.gosu
Status: NEW → ASSIGNED
Assignee: valentin.gosu → nobody
Blocks: doh-rollout
Status: ASSIGNED → NEW
Assignee: nobody → valentin.gosu
Status: NEW → ASSIGNED
Assignee: valentin.gosu → nobody
Status: ASSIGNED → NEW
Priority: P2 → P3
Attachment #9193106 - Attachment is obsolete: true
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: