zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
20.7k stars 639 forks source link

zellij hangs forever #2074

Open andresmrm opened 1 year ago

andresmrm commented 1 year ago

Hi!

I'm regularly having problems to attach to zellij running on a VPS and this problem has persisted for months. Generally the problem happens when I'm attached but the network connection dies. When it comes back and I try to attach again it just hangs and doesn't open zellij screen. I can login to the server using ssh without problem, but even a zellij ls hangs forever.

Sometimes I can recuperate the session killing all "zellij" processes except the main one. But sometimes even after that it still just hangs, forcing me to kill the server and reopen all the process I need to keep running there. Generally I leave about 5 process continuously running inside zellij.

Basic information

zellij --version: 0.34.4 stty size: 50 192 uname -av: Linux [...] 6.0.12-arch1-1

andresmrm commented 1 year ago

Ah, one thing that I noticed is that, when the attach do works after a network problem, I see the MY FOCUS AND: message for some time, even I'm being the only one accessing that zellij server. So it seems old connections take some time to close. But I'm not sure if this is related.

imsnif commented 1 year ago

@raphCode - do you think this could be related to the IPC stickiness issue you found?

If not, does it sound similar to something else you've encountered?

raphCode commented 1 year ago

The IPC stickiness is about sessions disappearing, I don't think it is related.

I sounds similar to the "fansari issue", but we believe to have resolved this.

Edit: I have no overview over the amount of threads we have in the server, but likely something in there may still be blocking on some I/O, leading to the lockups.

blitzerr commented 1 year ago

Zellij is awesome. It is slick and makes me productive for its age (pre 1.0). You folks are doing an excellent job.

I want to report on this issue. I run into it every time I do this:

Because I want to keep using zellij, I run my editor in zellij as it keeps the buffer minimum. And I run my builds in tmux. :) I will appreciate if this open issues catches the eyes of someone and they fix this.

raphCode commented 1 year ago

Run my build that easily generates over 5k+ lines of text on the terminal.

Interesting! I just discovered to long lines may lead to high memory consumption: #2104 In what form does zellij crash for you?

Could it be by any chance, that memory consumption is an issue when zellij hangs? Maybe the server process stalls because e.g. it is in a cgroup with memory limits and the kernel starts paging the process' memory? A system monitor might provide insights.

blitzerr commented 1 year ago

@raphCode I am not running zellij in a cgroup and the remote machine I use is quite hefty. But the suggestion to check system monitor is a good one. Let me check that and report back.

andresmrm commented 1 year ago

Could it be by any chance, that memory consumption is an issue when zellij hangs? Maybe the server process stalls because e.g. it is in a cgroup with memory limits and the kernel starts paging the process' memory? A system monitor might provide insights.

At least in my case this doesn't seem a memory problem. My VPS has lots of memory and usage stays to a minimum even while zellij doesn't respond.

robinmoussu commented 1 year ago

I just had the same issue (zellij ls hanging forever, as well as kiil-all-sessions and attach). I solved it by a pkill -9 zellij.

Unfortunately I did not found anything that could help to debug or solve this issue. That being said, I think that zellij started to hang when I selected something inside less, while having the right alt key pressed.

yggdr commented 2 months ago

I'm just testing out zellij as a possible alternative to tmux and almost immediately ran into this issue! All I need to do is run a new zellij, exit out of it with ^D, then zellij ls hangs indefinitely and I have a zellij server process running at 100% CPU. zellij 0.40.1 on FreeBSD 14.1-p2 with kitty 0.35.2 and various shells