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

Improve zellij exit to reduce error #2994

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

xuanyuan300
Copy link
Contributor

@xuanyuan300 xuanyuan300 commented Dec 7, 2023

Currently, when zellij exits, a number of errors are printed in the logs, such as the following error.

rors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/zellij-utils-0.39.1/src/errors.rs:632]: Panic occured:
             thread: screen
             location: At /home/wjd/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/zellij-server-0.39.1/src/lib.rs:817:18
             message: Program terminates: a fatal error occured

Caused by:
    0: failed to remove client 1
    1: Failed to log and report session state
    2: failed to send message to background jobs
    3: Originating Thread(s)
       	1. stdin_handler_thread: AcceptInput
       	2. ipc_server: ClientExit
       	3. screen_thread: RemoveClient
       
    4: failed to send message to channel 

This may lead the user to believe that a panic has occurred, but it does not actually affect usage.
Since there are multiple loops in zellij (server, screen, pty, plugin) and they async communicate through channels, the order in which the loops are closed may affect the errors.
This PR optimizes the stop logic of zellij to minimize the occurrence of errors.

Signed-off-by: xuanyuan300 <[email protected]>
Signed-off-by: xuanyuan300 <[email protected]>
Signed-off-by: xuanyuan300 <[email protected]>
Signed-off-by: xuanyuan300 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant