Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

src command hanging with 100% cpu usage #143

Open
neelance opened this issue May 1, 2015 · 8 comments
Open

src command hanging with 100% cpu usage #143

neelance opened this issue May 1, 2015 · 8 comments

Comments

@neelance
Copy link
Contributor

neelance commented May 1, 2015

I just tried srclib on some Go code with the Atom plugin and after some time I was wondering why my fan was going like crazy. I looked into the running tasks and found several src processes consuming all of my CPU. A killall src solved the problem.

I think it is important to avoid this situation, since it gives a very strong incentive to just uninstall the tool again. The output of most (all?) src commands is useless if it does not compute in a timely manner. So the command could have a watchdog that just kills the process after a fixed amount of time (maybe resettable by some indication of progress), just in case something gets stuck.

Next time it happens I'll try to track down what exactly is causing the seemingly infinite loop.

@emidoots
Copy link
Member

emidoots commented May 1, 2015

Sounds like it might be what I ran into in #137, but I'm not certain (and haven't had a chance to look into it yet).

If you're able to reproduce it maybe try finding out which src command (arguments / pwd) caused it and if possible a traceback (kill -SIGQUIT pid does the trick), so we could know if it's the same issue.

have a watchdog that just kills the process after a fixed amount of time (maybe resettable by some indication of progress), just in case something gets stuck.

That sounds like a superb idea in my opinion! 👍

@MaikuMori
Copy link
Contributor

As a dirty workaround I'll add timeout/stop logic to atom plugin, but this is an actual issue that I've also noticed.

My guess is that the issue is caused by multiple src instances being run at the same time which causes some sort of lock. There are other issues related to this as well like random errors which disappear on a clean run. I can look into how to patch it on editors side (run only 1 instance at a time), but hopefully it will be fixed in src tool itself.

@MaikuMori
Copy link
Contributor

Well the symptom is fixed in the atom plugin, the actual problem is still in src.

@jelmerdereus
Copy link
Contributor

great!! @MaikuMori

@beyang
Copy link
Member

beyang commented May 16, 2015

curious, what OS's are people running? I'm looking into another CPU utilization issue that I can only get to repro in Mac OS.

@dmitshur
Copy link
Contributor

I have also seen src using up 100% CPU at times, and I'm on OS X.

@emidoots
Copy link
Member

@beyang I was on Ubuntu 14.10 and either Go 1.4 or tip (I'm not sure). I tried to reproduce last week but couldn't anymore (I don't have any clue why).

@MaikuMori
Copy link
Contributor

Any chance you have had multiple instances of src running at the same time? If you're trying to reproduce it using Atom plugin then it shouldn't be possible anymore as it now runs commands sequentially.

I think I've seen src stuck at 100% cpu when multiple instances are running at the same time on the same project.

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

No branches or pull requests

6 participants