Retry geoclue after G_DBUS_ERROR_ACCESS_DENIED
Categories
(Toolkit :: Geolocation Provider, task)
Tracking
()
People
(Reporter: jstutte, Unassigned)
References
(Blocks 2 open bugs)
Details
From telemetry it appears that there is a very small number of clients that is responsible for a high number of geolocation requests. While since bug 2048118 these are mostly served through the cache, it is still kind of surprising that this happens.
I was not able to find the underlying mechanism that brings us into this state, but we can fairly easily rate limit the MLS requests, if we want.
On the affected Linux population, telemetry shows ~1,503 failed GeoClue Start attempts per client-day with geolocation.fallback[none] at zero - i.e. every single attempt ends in an MLS fallback, and none of them ever recovers within the session. The observed D-Bus error is G_DBUS_ERROR_ACCESS_DENIED, which Firefox treats as permission-denied.
A GeoClue client is started on behalf of whoever asks for a position, so the attempt rate is set by callers rather than by the provider. On a system where Start can never succeed - no service running, or a sandboxed package whose access is refused - that produces an unbounded stream of attempts, each costing D-Bus round-trips, CPU, and one network geolocation request via the MLS fallback.
Proposed fix: exponential backoff between Start attempts, in a GeoclueStartRetryPolicy that holds no GeoClue or D-Bus state (clock injected) so it can be unit-tested on its own. Two new prefs: geo.provider.geoclue.start_backoff_base_ms (5s) and geo.provider.geoclue.start_backoff_max_ms (300s). It deliberately never gives up, because the geoclue-agent workaround in GeoclueLocationProvider can recover once the agent connects - the retry path has to stay open, it only needs a sane cadence.
| Reporter | ||
Updated•3 months ago
|
Comment 1•3 months ago
|
||
I'm not sure any fallback timer is worth here, retrying every time immediately should be fine as there's no payment bill for geoclue access.
Comment 2•3 months ago
|
||
See also bug 1882464 which retries libnotify every time immediately.
Comment 3•3 months ago
|
||
| Reporter | ||
Updated•3 months ago
|
Description
•