Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yazi does not respond to SIGTERM when running a subprocess #796

Closed
musjj opened this issue Mar 10, 2024 · 2 comments · Fixed by #797
Closed

yazi does not respond to SIGTERM when running a subprocess #796

musjj opened this issue Mar 10, 2024 · 2 comments · Fixed by #797
Labels
bug Something isn't working waiting on op Waiting for more information from the original poster

Comments

@musjj
Copy link
Contributor

musjj commented Mar 10, 2024

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

kitty v0.32.2

Did you try the latest main branch to see if the problem got fixed?

Tried, but the problem still happens.

yazi --debug output

Yazi
    yazi 0.2.4 (VERGEN_IDEMPOTENT_OUTPUT 1980-01-01)

Environment
    OS: linux-x86_64 (unix)
    Debug: false

Emulator
    Emulator.via_env: ("xterm-kitty", "")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect: Kitty

Adaptor
    Adaptor.matches: Wayland

tmux
    TMUX: false

Zellij
    ZELLIJ_SESSION_NAME: Some("triangular-yak")

Desktop
    XDG_SESSION_TYPE: Some("wayland")
    WAYLAND_DISPLAY: Some("wayland-1")
    DISPLAY: Some(":0")

Ueberzug
    Version: Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Describe the bug

While running a blocking subprocess, yazi will stop responding to any SIGTERM. One of the side-effects from this is really long shutdown times on systemd-based OSes, if you happen to have yazi running in the background while shutting down.

When shutting down, systemd will try to send SIGTERM to politely terminate any running processes. It will wait for a certain time-out length (1m30s for me), before finally giving up with a SIGKILL instead.

From the journalctl logs
Mar 03 04:36:57 $HOST systemd[1]: Stopping User Login Management...
Mar 03 04:36:57 $HOST systemd[1]: Stopping Permit User Sessions...
Mar 03 04:36:57 $HOST systemd[1]: Stopping User Manager for UID 1000...
...
Mar 03 04:36:56 $HOST systemd[1]: session-3.scope: Stopping timed out. Killing.
Mar 03 04:36:56 $HOST systemd[1]: session-3.scope: Killing process 1090825 (.yazi-wrapped) with signal SIGKILL.
Mar 03 04:36:56 $HOST systemd[1]: session-3.scope: Failed to kill control group /user.slice/user-1000.slice/session-3.scope, ignoring: Invalid argument
Mar 03 04:36:56 $HOST systemd[1]: session-3.scope: Failed with result 'timeout'.
Mar 03 04:36:57 $HOST systemd[1]: Stopped Session 3 of User $USER.

Expected Behavior

yazi should always respond to SIGTERM.

To Reproduce

  1. Run EDITOR=vim yazi and edit any text file
  2. From a different shell, run killall yazi (or killall .yazi-wrapped on Nix)

You could also run shell --block, then sleep 15s for a similar effect.

Configuration

no config

Anything else?

I recently read this: https://registerspill.thorstenball.com/p/how-to-lose-control-of-your-shell, and the symptoms look eerily similar to what I'm experiencing (I'm also using zsh). Could it be related?

@sxyazi
Copy link
Owner

sxyazi commented Mar 10, 2024

Thanks for the report, please try #797

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Mar 10, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working waiting on op Waiting for more information from the original poster
Projects
None yet
2 participants