gdm/util: Reduce the fprintd proxy wait timeout

Given that this may lead to the shell to hang on gdm startup, and that
we expect the service to be up and running quickly, we can safely set a
5 seconds timeout instead of using the longer GLib proxy defaults.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>
This commit is contained in:
Marco Trevisan (Treviño) 2022-04-12 17:05:02 +02:00
parent fa25156a6c
commit 7552875dbc

View File

@ -43,6 +43,7 @@ export const DISABLE_USER_LIST_KEY = 'disable-user-list';
// Give user 48ms to read each character of a PAM message
const USER_READ_TIME = 48;
const FINGERPRINT_SERVICE_PROXY_TIMEOUT = 5000;
const FINGERPRINT_ERROR_TIMEOUT_WAIT = 15;
/**
@ -358,6 +359,10 @@ export class ShellUserVerifier extends Signals.EventEmitter {
// option, so go ahead a synchronously look for a fingerprint device
// during startup or default service update.
fprintManager.init(null);
// Do not wait too much for fprintd to reply, as in case it hangs
// we should fail early without having the shell to misbehave
fprintManager.set_default_timeout(FINGERPRINT_SERVICE_PROXY_TIMEOUT);
const [devicePath] = fprintManager.GetDefaultDeviceSync();
this._fprintManager = fprintManager;