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

Endless refresh loop, high CPU usage after refresh or change in refs/main split view #991

Closed
ghost opened this issue Feb 25, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 25, 2020

First of all, thanks for a great tool; tig is pretty much the only git client I use since discovering it :)

Since tig version 2.5.0, when a refs/main split view is open and a refresh is triggered, an endless refresh loop (and high CPU usage, at least 50% of a single core on my systems) happens. Depending on the repository and machine, the refreshes may be visible (both views 'flicker' visibly), possibly very often (many times a second). Moving the cursor in this state becomes problematic as well.

To reproduce:

  • Start tig with a clean/no user rc (I used TIGRC_USER="" tig here)
  • Open a split view of refs and main (either horizontal or vertical will do)
  • Do a refresh (e.g. F5)
    • Manual actions that seem to trigger an 'internal refresh' also seem to work (e.g. :exec !git commit or :exec !git commit --amend)
  • Tig now starts to refresh constantly, resulting in high CPU usage as well (e.g. in top)
  • Get rid of the split view (e.g. q or O) and everything turns back to normal (including CPU usage), even when re-opening the refs/main split.
    • Switching to a different split (e.g. hit Enter on the selected commit to go into a main/diff split) also turns everything back to normal
  • Get into the refs/main split again and do a refresh (e.g. F5) or manual action that triggers a refresh and the issue is back.

This happens on all repositories I work on and I can reproduce this on both the tig.git and git.git repositories (the latter only refreshes every few seconds as it seems to wait for the main view to be done populating before doing the next refresh).

As far as I remember the refs/main split is the only split in which I noticed this issue. Some other situations I've explicitly tested:

  • It's not an issue when only having either the main or ref views open and performing the same actions that trigger the problem
  • It's not an issue with a main/diff split view and performing the same actions that trigger the problem

Version info:

  • OS: Ubuntu 18.04.4
  • tig --version:
tig version 2.5.0
ncursesw version 6.1.20180127
readline version 8.0

Note: the version of readline that's used is installed via brew (as is tig itself)

@ghost
Copy link
Author

ghost commented Mar 2, 2020

Some additional info: on a very small repo (only master and origin/master branches, about 20 commits and about 10 tags) I could not reproduce it. It does seem to refresh a few times max (3-5?) when hitting F5 but then it stops.

@ghost
Copy link
Author

ghost commented Mar 3, 2020

Just compiled master locally and can confirm. Thanks for fixing!

koutcher added a commit that referenced this issue Oct 21, 2023
This is a regression from #991. Bring back and improve correction from #591.

Fixes #1270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant