[gnome-shell/gnome-40] windowManager: Remove timeout on starting X11 services



commit 5ee73ec7609c56e0a2a6e01c8570864c6740700c
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Tue Jun 15 08:50:56 2021 +0200

    windowManager: Remove timeout on starting X11 services
    
    With Xwayland started on demand, mutter/gnome-shell will spawn Xwayland
    and GNOME settings daemon Xsettings.
    
    Currently, gnome-shell uses a timeout of 5 seconds before canceling the
    launch and declare failure to start X11 services.
    
    While 5 seconds may seem like a lot of time, when this is executed on a
    virtual machine part of a QA tests under load, this causes random
    failures.
    
    There is no good value here, we could increase the timeout but it will
    always remain racy. Instead, remove the timeout, systemd itself already
    has a timeout mechanism (with a much longer wait time).
    
    Thanks to Benjamin Berg <bberg redhat com> for finding the root cause
    and suggesting the fix.
    
    (cherry picked from commit 8be5d336118b5403e04fc16bc2017f8915b787c9)
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1889>

 js/ui/windowManager.js | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index bacb6dddb5..d01bac19c7 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -907,14 +907,7 @@ var WindowManager = class {
         global.display.connect('init-xserver', (display, task) => {
             IBusManager.getIBusManager().restartDaemon(['--xim']);
 
-            /* Timeout waiting for start job completion after 5 seconds */
-            let cancellable = new Gio.Cancellable();
-            GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 5, () => {
-                cancellable.cancel();
-                return GLib.SOURCE_REMOVE;
-            });
-
-            this._startX11Services(task, cancellable);
+            this._startX11Services(task);
 
             return true;
         });
@@ -972,11 +965,11 @@ var WindowManager = class {
         });
     }
 
-    async _startX11Services(task, cancellable) {
+    async _startX11Services(task) {
         let status = true;
         try {
             await Shell.util_start_systemd_unit(
-                'gnome-session-x11-services-ready.target', 'fail', cancellable);
+                'gnome-session-x11-services-ready.target', 'fail', null);
         } catch (e) {
             // Ignore NOT_SUPPORTED error, which indicates we are not systemd
             // managed and gnome-session will have taken care of everything


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]