Skip to content

Niri cannot be frozen when session locked #2439

Description

@RMTT

Recently i'm using noctalia-shell(based on quickshell) and swayidle, and following is my swayidle's configuration:

  services.swayidle = {
    enable = true;
    timeouts = [
      {
        timeout = 600;
        command = "${pkgs.noctalia}/bin/noctalia-shell ipc call lockScreen toggle";
      }
      {
        timeout = 1800;
        command = "${pkgs.niri}/bin/niri msg action power-off-monitors";
      }
    ];
  };

It's configured by home-manager and it's very simple.
After the desktop remains idle for 10 minutes, invoking noctalia-shell ipc call lockScreen toggle to open a lock screen ui;
After the desktop remains idle for 30 minutes, invoking niri msg action power-off-monitors to power-off monitors;

After niri msg action power-off-monitors, systemd-logind will start suspending and an error will occur:

Sep 24 15:01:19 mtspc systemd-sleep[71623]: Failed to freeze unit 'user.slice': Connection timed out
Sep 24 15:01:19 mtspc systemd-sleep[71623]: Performing sleep operation 'suspend'...
Sep 24 15:01:19 mtspc kernel: PM: suspend entry (s2idle)
Sep 24 15:01:19 mtspc kernel: Filesystems sync: 0.008 seconds
Sep 24 15:01:39 mtspc kernel: Freezing user space processes
Sep 24 15:01:39 mtspc kernel: Freezing user space processes failed after 20.007 seconds (1 tasks refusing to freeze, wq_busy=0):
Sep 24 15:01:39 mtspc kernel: task:niri            state:D stack:0     pid:2348  tgid:2348  ppid:2293   task_flags:0x400000 flags:0x00004006
Sep 24 15:01:39 mtspc kernel: Call Trace:
Sep 24 15:01:39 mtspc kernel:  <TASK>
Sep 24 15:01:39 mtspc kernel:  __schedule+0x465/0x12f0
Sep 24 15:01:39 mtspc kernel:  schedule+0x27/0xd0
Sep 24 15:01:39 mtspc kernel:  schedule_preempt_disabled+0x15/0x30
Sep 24 15:01:39 mtspc kernel:  __mutex_lock.constprop.0+0x3f5/0x7d0
Sep 24 15:01:39 mtspc kernel:  drm_mode_getconnector+0x11e/0x480
Sep 24 15:01:39 mtspc kernel:  ? __pfx_drm_mode_getconnector+0x10/0x10
Sep 24 15:01:39 mtspc kernel:  drm_ioctl_kernel+0xab/0x100
Sep 24 15:01:39 mtspc kernel:  drm_ioctl+0x273/0x560
Sep 24 15:01:39 mtspc kernel:  ? __pfx_drm_mode_getconnector+0x10/0x10
Sep 24 15:01:39 mtspc kernel:  __x64_sys_ioctl+0x93/0xe0
Sep 24 15:01:39 mtspc kernel:  do_syscall_64+0xb7/0x370
Sep 24 15:01:39 mtspc kernel:  entry_SYSCALL_64_after_hwframe+0x77/0x7f
Sep 24 15:01:39 mtspc kernel: RIP: 0033:0x55736dc17d0e
Sep 24 15:01:39 mtspc kernel: RSP: 002b:00007ffd8adc03d0 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
Sep 24 15:01:39 mtspc kernel: RAX: ffffffffffffffda RBX: 000000000000002d RCX: 000055736dc17d0e
Sep 24 15:01:39 mtspc kernel: RDX: 00007ffd8adc0440 RSI: 00000000c05064a7 RDI: 000000000000002d
Sep 24 15:01:39 mtspc kernel: RBP: 0000000000000000 R08: 00007ffd8adc05a0 R09: 0000000000000080
Sep 24 15:01:39 mtspc kernel: R10: 00007ffd8adc0570 R11: 0000000000000246 R12: 00007ffd8adc0588
Sep 24 15:01:39 mtspc kernel: R13: 00005573a0008a10 R14: 0000000000000000 R15: 0000000000000000
Sep 24 15:01:39 mtspc kernel:  </TASK>
Sep 24 15:01:39 mtspc kernel: OOM killer enabled.
Sep 24 15:01:39 mtspc kernel: Restarting tasks: Starting
Sep 24 15:01:39 mtspc kernel: Restarting tasks: Done
Sep 24 15:01:39 mtspc kernel: random: crng reseeded on system resumption

I noticed that quickshell implemented ext-session-lock, when lock screen toggled, niri will update LockedHint of Logind.

Any thoughts for the root cause?

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