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

Seeing high CPU usage for libexec/goenv-version-file #257

Open
FlorianLoch opened this issue Oct 19, 2022 · 1 comment
Open

Seeing high CPU usage for libexec/goenv-version-file #257

FlorianLoch opened this issue Oct 19, 2022 · 1 comment
Labels

Comments

@FlorianLoch
Copy link

FlorianLoch commented Oct 19, 2022

Hello,
I am seeing the following in htop (but also in other places) havin goenv on my M1 MacBook:

goenv

That keeps basically running all the time, sometimes there is even more than one instances consuming multiple CPU cores.

Killing the process doesn't really help as it gets restarted.

goenv-version-file seems to get (re-)started by goenv-version-name which again gets started by goenv-sh-rehash --only-manage-paths.
Following the chain further up probably isn't too helpful but it looks like goenv's initial invocation comes from zsh (probably looking for the current dir's Go version as I have enabled showing it in powerlevel10k), which gets started by some macOS system update component (which, indeed, seems to be stuck - so that would make sense).

Any idea why goenv-version-file keeps on searching without ever coming to an end?

@syndbg syndbg added the bug label Oct 20, 2022
@syndbg
Copy link
Member

syndbg commented Oct 20, 2022

I don't exclude the possibility of this being a bug, I haven't personally hit it before.
Hmm, do you have a bit more to show from your .zshrc? Looking for a loopy bootstrap logic.

Other than that I'm not a user of powerlevel10k, but I can check it out a bit. Seeing some interesting usage in https://github.com/romkatv/powerlevel10k/blob/master/internal/p10k.zsh#L4418

Also, can you set in your .zshrc export GOENV_DEBUG=1 so that you can gather and share logs such as

...
 [goenv-version-file:26] root=/home
+ [goenv-version-file:11] [[ /home =~ ^//[^/]*$ ]]
+ [goenv-version-file:12] '[' -e /home/.go-version ']'
+ [goenv-version-file:17] '[' -e /home/go.mod ']'
+ [goenv-version-file:22] '[' -z /home ']'
+ [goenv-version-file:26] root=
+ [goenv-version-file:11] [[ '' =~ ^//[^/]*$ ]]
+ [goenv-version-file:12] '[' -e /.go-version ']'
+ [goenv-version-file:17] '[' -e /go.mod ']'
+ [goenv-version-file:22] '[' -z '' ']'
+ [goenv-version-file:23] break
+ [goenv-version-file:28] return 1
+ [goenv-version-file:35] '[' /home/syndbg/.goenv '!=' /home/syndbg/.goenv ']'
+ [goenv-version-file:36] echo /home/syndbg/.goenv/version
...

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

No branches or pull requests

2 participants