Bug 2174753 - reboot/poweroff/logout from GNOME are 60 seconds delayed without 3D acceleration
Summary: reboot/poweroff/logout from GNOME are 60 seconds delayed without 3D acceleration
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-shell
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Müllner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: AcceptedFreezeException AcceptedBlocker
: 2173139 (view as bug list)
Depends On:
Blocks: F38BetaFreezeException F38FinalBlocker
TreeView+ depends on / blocked
 
Reported: 2023-03-02 11:36 UTC by Kamil Páral
Modified: 2023-03-09 22:53 UTC (History)
16 users (show)

Fixed In Version: gnome-shell-44~beta-3.fc38
Clone Of:
Environment:
Last Closed: 2023-03-09 22:53:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
system journal (348.89 KB, text/plain)
2023-03-02 11:36 UTC, Kamil Páral
no flags Details
list of all packages (62.50 KB, text/plain)
2023-03-02 11:37 UTC, Kamil Páral
no flags Details
endSessionDialog: Don't emit 'closed' until handler is connected (3.58 KB, patch)
2023-03-06 01:11 UTC, Ray Strode [halfline]
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME gnome-shell merge_requests 2677/ 0 None None None 2023-03-06 01:27:05 UTC

Description Kamil Páral 2023-03-02 11:36:00 UTC
Description of problem:
When running latest GNOME 44 on Fedora 38 in a virtual machine (I haven't tested bare metal yet), **reboot/poweroff/logout actions are 60 seconds delayed**. When I try to trigger them from the system menu, seemingly nothing happens. I can still interact with the desktop, control apps, everything. After 60 seconds, the action finally happens.

There is a workaround for reboot/poweroff. When I try to invoke them for the second time, they are finally triggered, reducing the delay. However, that workaround doesn't work for logout, that's always 60 seconds delayed.

When I send the acpi poweroff signal, it works instantly. Also `systemctl reboot/poweroff` works instantly. Just actions triggered by **GNOME buttons** are delayed.

This happens consistently on different VMs (all standard libvirt VMs created through virt-manager or gnome-boxes).


Version-Release number of selected component (if applicable):
Fedora-Workstation-Live-x86_64-38-20230301.n.0.iso
gnome-session-43.0-2.fc38.x86_64
gnome-shell-44~beta-2.fc38.x86_64
gdm-43.0-4.fc38.x86_64
systemd-253-1.fc38.x86_64
kernel-6.2.0-0.rc8.57.fc38.x86_64


How reproducible:
always

Steps to Reproduce:
1. install F38 Workstation, log in
2. hit logout/reboot/poweroff from the system menu
3. wait 60 seconds
4. it finally happens

Comment 1 Kamil Páral 2023-03-02 11:36:46 UTC
Created attachment 1947475 [details]
system journal

Here's a system journal, when I started the system logged in, and then tried to reboot. Waited 60 seconds, then the reboot finally happened.

Comment 2 Kamil Páral 2023-03-02 11:37:10 UTC
Created attachment 1947476 [details]
list of all packages

Comment 3 Kamil Páral 2023-03-02 11:38:45 UTC
Proposing as a Beta blocker:
"Shutting down, rebooting, logging in and logging out must work using standard console commands and the mechanisms offered (if any) by all release-blocking desktops. "
https://fedoraproject.org/wiki/Fedora_38_Beta_Release_Criteria#Shutdown,_reboot,_login,_logout

Comment 4 Lukas Ruzicka 2023-03-02 13:30:26 UTC
I cannot reproduce on my laptop, which restarts and switches off just fine, but I am seeing this on a fully updated VM, too.

Comment 5 František Zatloukal 2023-03-02 18:26:04 UTC
This happens also on bare metal when there is no GPU 3D acceleration (tested llvmpipe driver). And as expected, doesn't occur in VMs with 3D acceleration enabled (virtio). I'd guess mutter/gnome-shell would be the right component, but will leave re-assign for somebody more proficient.

Comment 6 Adam Williamson 2023-03-02 22:18:23 UTC
+4 for Beta FE in https://pagure.io/fedora-qa/blocker-review/issue/1064 , marking accepted. Blocker vote is more split.

Comment 7 Michael Catanzaro 2023-03-05 17:50:18 UTC
(In reply to František Zatloukal from comment #5)
> This happens also on bare metal when there is no GPU 3D acceleration (tested
> llvmpipe driver).

It would seem odd for a bug like this to be associated with GPU, but I suppose strange things happen sometimes. FWIW it happens for me on bare metal with AMD Radeon™ RX 570 Series graphics.

Comment 8 Ray Strode [halfline] 2023-03-06 00:44:42 UTC
can someone who is seeing this please put 

GNOME_SESSION_DEBUG=1

in /etc/environment, reboot, reproduce, and then attach the full unfiltered output of

journactl -b

?

Comment 9 Ray Strode [halfline] 2023-03-06 00:59:44 UTC
actually, just from reading the javascript, I think I see the problem...

gnome-shell has this code:

            let button = this.addButton({•                         
                action: () => {•                                   
                    this.close(true);•                             
                    let signalId = this.connect('closed', () => {• 
                        this.disconnect(signalId);•                
                        this._confirm(signal);•                    
                    });•                                           
                },•                                                
                label,•                                            
            });•                                                   

So you can see it calls close and then connects to the closed signal.  if calling close leads to the closed getting emitted right away, then the button wouldn't get confirmed until it's 60 second timeout of the dialog.

Looking at the close method:

    _closeComplete() {•               
        this._setState(State.CLOSED);•
        this.hide();•                 
        this.emit('closed');•         
•                                     
        if (this._destroyOnClose)•    
            this.destroy();•          
    }•                                
...
   close(timestamp) {•        
...
           this.ease({•                                        
               opacity: 0,•                                    
               duration: OPEN_AND_CLOSE_TIME,•                 
               mode: Clutter.AnimationMode.EASE_OUT_QUAD,•     
               onComplete: () => this._closeComplete(),•       
           });•                                                                                                  
...
    }•  

At some point somewhat recently gnome-shell got a change to make the ease function call onComplete right away when animations are disabled, so that change is incompatible with calling close before setting up the handler

Comment 10 Ray Strode [halfline] 2023-03-06 01:11:47 UTC
Created attachment 1948242 [details]
endSessionDialog: Don't emit 'closed' until handler is connected

    Prior to commit 7bd98f3f5fb7e0d1220646b8a4ee7073534a8e8f animation
    onComplete handlers always occured at least after one main loop
    iteration.
    
    Now, if animations are disabled, they can get invoked immediately.
    
    That breaks the endSessionDialog button handler, which calls
    close before setting up the "closed" signal handler.
    
    This commit fixes the handler to get set up first.

Comment 11 Ray Strode [halfline] 2023-03-06 01:12:08 UTC
i think that ^ should fix it.

Comment 12 Ray Strode [halfline] 2023-03-06 01:19:05 UTC
scratch build here if anyone wants to try it Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=98341733

Comment 13 Ray Strode [halfline] 2023-03-06 01:35:12 UTC
just to follow up, I was able to reproduce the issue, and confirm the scratch build makes it go away for me.

I'd still like someone not-me to try it, but assuming it gets one more yes vote, I'll do a "real" build.

Comment 14 Adam Williamson 2023-03-06 07:14:06 UTC
We've got -5 beta blocker +6 final blocker in https://pagure.io/fedora-qa/blocker-review/issue/1064 , so confirming those.

Comment 15 Luna Jernberg 2023-03-06 09:04:07 UTC
Having the same problem, when testing today in a Virtualbox VM on my new Ryzen desktop

Comment 16 Ray Strode [halfline] 2023-03-06 09:32:55 UTC
Luna, can you try the scratch builds? or was that with the scratch builds?

Comment 17 František Zatloukal 2023-03-06 09:38:35 UTC
I've verified the scratch build fixes the issue for me in these cases:
- bare metal with animations off
- bare metal with llvmpipe
- VM without virgl

Bare metal had AMD GPU (Van Gogh/RDNA 2).

Comment 18 Ray Strode [halfline] 2023-03-06 09:56:31 UTC
great thanks.

Comment 19 Fedora Update System 2023-03-06 11:21:18 UTC
FEDORA-2023-8d52e0617f has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-8d52e0617f

Comment 20 Michael Catanzaro 2023-03-06 15:19:36 UTC
(In reply to Michael Catanzaro from comment #7)
> FWIW it happens for me on bare
> metal with AMD Radeon™ RX 570 Series graphics.

Uh, I see that I do have animations disabled, but that must be a bug. I wonder what component is responsible for deciding whether to enable gnome-shell animations? gnome-shell itself, I guess?

Comment 21 Ray Strode [halfline] 2023-03-06 17:53:30 UTC
maybe org.gnome.desktop.interface enable-animations is set to false? maybe you're screen casting ?

Comment 22 František Zatloukal 2023-03-06 19:04:51 UTC
FEDORA-2023-8d52e0617f fixes the issue.

Comment 23 Fedora Update System 2023-03-07 02:03:07 UTC
FEDORA-2023-8d52e0617f has been pushed to the Fedora 38 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-8d52e0617f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 24 Luna Jernberg 2023-03-07 07:51:30 UTC
FEDORA-2023-8d52e0617f fixed it for me

Comment 25 Phil Wyett 2023-03-07 10:17:51 UTC
*** Bug 2173139 has been marked as a duplicate of this bug. ***

Comment 26 Fedora Update System 2023-03-09 22:53:30 UTC
FEDORA-2023-8d52e0617f has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.