Skip to content

feat(wifi): make backend selection re-entrant so a transient probe failure recovers without a restart (#609 follow-up) #613

Description

@vibechoom

Deferred scope from PR #609 (the #607 probe fix). Filing so it doesn't stay parked only in a merged PR body.

What

#609 made an inconclusive backend probe distinguishable from "this host has no wireless hardware" — the failure now logs at error! and points at systemctl --user restart trollshell. What it deliberately did not do is recover on its own. From the PR body:

Re-probing / retrying until a backend appears. wifi/mod.rs branches on the verdict and spawns a different watcher per backend, so re-probing means restructuring that selection, not re-calling a function. I did not touch the watcher-spawning structure, and deliberately did not add a retry loop inside probe_backend either — a retry would mask how often the failure actually [occurs].

So a transient D-Bus failure at startup — a slow NetworkManager on a cold boot is the obvious candidate — still silences the Wi-Fi section for the whole session, and the only remedy is a manual restart.

Severity

Medium. The user-visible symptom is the one originally reported in #607 (Wi-Fi section simply gone), and the workaround is a shell restart. #609 downgraded it from silent-and-inexplicable to loud-and-explicable, which is a real improvement but not a fix.

Why it wasn't just fixed

Two reasons, both good:

  1. It's a restructure, not a retry. wifi/mod.rs branches on the verdict and spawns a different watcher per backend, so "probe again" means making backend selection re-entrant rather than a one-shot at startup.
  2. fix(wifi): a failed backend probe is no longer indistinguishable from "no backend" (#607) #609's author deliberately wanted the failure to stay loud so we learn how often it actually fires. A retry loop added at the same time would have hidden exactly the signal the error! line was added to collect.

Recommendation

Gate this on evidence, not on appetite. Point 2 is the important one: the whole reason the error! line exists is to measure frequency, and building the retry now discards that measurement before it's taken. Wait until we have at least one confirmed sighting of the log line in the wild (#607 is the live candidate — see the note there about the line retroactively confirming the diagnosis).

If and when it's worth building: make the backend selection re-entrant — a supervising task that owns "which watcher is running" and can tear one down and spawn another — rather than a retry inside probe_backend. Bounded exponential backoff, and it must stop retrying once a backend is chosen, so a working host doesn't poll forever.

Refs #609, #607.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions