-
Notifications
You must be signed in to change notification settings - Fork 626
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
100% CPU when closing terminal window before quitting tig #164
Comments
Could you try with bash and see if this still happens? |
Hmm, apparently this only happens with ZSH, and for me only with the version that ships with OSX.8 (which is |
I've tried to reproduce this on OS X 10.8.4 (i386-apple-darwin12.4.0) by manually compiling zsh-4.3.11 and launching it inside iTerm, but didn't succeed. I am not sure if it could be related with the ZSH configuration, since I am using an empty ~/.zshrc. The only way I see right now is to compile tig with debugging enabled ( |
It could be some bug with the bash tig completion file if you loaded that via zsh's compat mode. Anyway, I need more information to find the source of this. Please feel free to reopen this issue if you find the time and want to help fix this. |
Happens to me fairly consistently with |
OK, I'll try to reproduce when I get some time. |
I can also confirm, happened with fish shell here as well. |
|
Any news on this issue? |
@madmax As I am using neither zsh nor fish any help figuring out what causes this would be much appreciated. |
EDIT: Just happened again. |
The problem comes from the shell configuration rather than from tig itself as when you close the window, all processes run from the terminal are supposed to receive a hangup signal. With zsh, this won't happen if you have the command "setopt nohup" in your profile, and you end up with a tig process using 100% CPU most probably because it's looking for its closed tty. And from fish issues you can see that, at some points, fish had some problems with killing child processes. |
Thanks @koutcher for the explanation. I can reproduce by opening a new terminal, running Will look into where there might be a missing error check in the event loop. |
Thanks everybody for the feedback. I've implemented a workaround to detect busy loops since I was not able to find a way to determine whether the TTY was lost |
Hi @jonas, the busy loop detection kills my tig process whenever I want to browse a large git repo, e.g. like the OpenBSD one (https://github.com/openbsd/src). tig works fine here with smaller repos. I am running tig Version 2.3.1 on OpenBSD amd64 6.2-current. I upgraded yesterday from 2.3.0 to 2.3.1 and suddenly browsing large repos does not work any longer. Let me know if I can provide you further info. |
I assume it hit the busy loop detection here since I want to open up a really large repo stored on OpenBSD's Fast File System (FFS) which is not as fast as other file systems. Loading the whole git repo in tig here takes about 5s wall-clock time. |
Thanks for reporting this. The workaround is terrible, I might end up removing it again. Will try to get a new release out ASAP. |
I've released 2.3.2 just now. Sorry for the noise. Busy loop detection is now only triggered when no views are loading. |
I can confirm that 2.3.2 fixes my issue. Thanks @jonas for your quick help, much appreciated! |
Thanks for testing. |
I think this busy loop detection is probably the wrong idea. Surely, we should simply exit on
Untested, but demonstrates the idea. |
I agree it is a terrible hack. And would be open to remove the workaround and mark the issue as "won't fix". My understanding is that Tig never received the |
I couldn't get things into a situation where But certainly the |
You are right. Thanks @ThomasAdam. Meh, I don't know what I was thinking. 🤦♂️ |
Thanks to Thomas Adam for proposing this.
That is a bit strange because the purpose of nohup is normally to intercept the HUP signal... It doesn’t hurt to handle HUP properly but I doubt it will solve the issue completely. Indeed, with tig compiled from master, if you start zsh, do a setopt nohup, start tig and close the window you still end with a tig process using 100% CPU. On the other hand I’m not sure there’s a need to do anything as users who are bothered by this problem can fix their shell configuration (i.e. remove setopt nohup or add a setopt hup if their zsh was compiled to be in nohup by default). |
Hi @jonas, would it be possible to release a new version with the fix? I'm getting hit by "tig: Busy loop detected" a lot. There's only one issue blocking 2.3.3, but it seems like a big one. |
@stefanchrobot Released 2.3.3 based on current master. |
Thanks! |
@jonas thanks! Can you also "publish" the tar.gz and tar.gz.md5 files as well (as with e.g. 2.3.2)? |
Done, sorry about that.
|
I've been using the 2.3.3 release for a few days now and it's great! Thanks for fixing this! |
If I close my terminal window which has a still running instance of tig in it, tig keeps running in the background and climbs up to 100% CPU usage.
I'm on a mac, using iTerm2 and zsh.
The text was updated successfully, but these errors were encountered: