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

io.js + silent prepare issue #61

Closed
revolunet opened this issue Aug 4, 2015 · 5 comments · Fixed by #66
Closed

io.js + silent prepare issue #61

revolunet opened this issue Aug 4, 2015 · 5 comments · Fixed by #66

Comments

@revolunet
Copy link

Hello, for information, looks like the webworkers used in some scripts are not compatible with io.js

Here : https://github.com/alunny/node-xcode/blob/master/lib/pbxProject.js#L22-L40

If you use io.js, the worker dies silently and then the cordova prepare task fail silently too, which leads to unexpected results.

While io.js support is luxury, having a way to inform the user if the webworker or prepare phase fails for some reason would save some headaches :)

I tried to add exit/error/close callbacks to the worker with no luck... any idea ?

@revolunet
Copy link
Author

link to related issue on cordova tracker : https://issues.apache.org/jira/browse/CB-9297

@pmuellr
Copy link

pmuellr commented Sep 1, 2015

Wondering if it's related to sync/async use of send() from child to parent process - there's a fix going in node 4 that will help - nodejs/node#2620 - I believe the implication is that you'd put the process.exit() calls inside the send() callback. Until then, you could probably put the process.exit() in a setTimeout() of a second or so.

@vladimir-kotikov
Copy link
Contributor

Not sure if we need to forcibly call process.exit(), since the exit code of spawned process is not tracked anywhere. As for me it's just enough to try to parse and send either parsed result or error back and let node take care of spawned process. @pmuellr, your thoughts?

@pmuellr
Copy link

pmuellr commented Sep 14, 2015

Welp, usually adding process.exit() is bit heavy-handled, in most apps.

OTOH, if the usage in this case is within parseJob.js, as indicated in pbxProject.js, then process.exit() doesn't appear to be too heavy-handed, in context. Everyone else is already doing it! :-)

@sgrebnov
Copy link
Contributor

I think we can simply remove process.exit call as process exit status is not used or specify exitCode instead.

vladimir-kotikov pushed a commit to vladimir-kotikov/node-xcode that referenced this issue Sep 16, 2015
This fixes the issue, caused by changed `process.send` behaviour (which became async at one time, so `process.exit` terminates worker before the message will be sent completely).

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

Successfully merging a pull request may close this issue.

4 participants