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

100% CPU usage after pm2 start on Windows #1039

Closed
morkai opened this issue Feb 24, 2015 · 4 comments
Closed

100% CPU usage after pm2 start on Windows #1039

morkai opened this issue Feb 24, 2015 · 4 comments

Comments

@morkai
Copy link

morkai commented Feb 24, 2015

Hello!

When starting a new process, the CPU usage of the daemon (Satan.js) goes up to 100%, because of an infinite loop of fs.exists() calls.

God.finalizeProcedure() calls vision.analyze() with the full pm2's exec path and then goes down to the root path, where it should stop. The stop condition only checks for /, but on Windows the root path is <disk letter>:\ (e.g. C:\) and thus the process never stops (non-stop checks whether C:\.git, C:\.hg and C:\.svn exist). Check out this output from node-tick-processor.

The God.js#L440 currently looks like this:

    else if (err && current_path == '/') {

and should be something like:

    else if (err && (current_path === '/' || /^[A-Za-z]:\\$/.test(current_path))) {

Windows 8.1 64-bit, Node.js v0.10.35, pm2 v0.12.6

@soyuka
Copy link
Collaborator

soyuka commented Feb 24, 2015

@echiu64 thoughts?

#584

jshkurti added a commit that referenced this issue Feb 25, 2015
@jshkurti
Copy link
Contributor

It should be ok now, can you try ?
$ npm install git://github.com/Unitech/pm2#development -g

Thanks for reporting this.

@morkai
Copy link
Author

morkai commented Feb 25, 2015

It's OK now, 0% CPU usage :)

@jshkurti
Copy link
Contributor

Glad I could help :)

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

3 participants