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

Node >= 12.5 issues in OSX when using GNU parallel #28752

Closed
JuanCsfx opened this issue Jul 18, 2019 · 9 comments
Closed

Node >= 12.5 issues in OSX when using GNU parallel #28752

JuanCsfx opened this issue Jul 18, 2019 · 9 comments
Labels
console Issues and PRs related to the console subsystem. macos Issues and PRs related to the macOS platform / OSX.

Comments

@JuanCsfx
Copy link

Version: 12.5.0 or 12.6.0
Platform: Mac OSX 10.14.5

Running a simple node script (e.g. a file with a single console.log("Test")) works fine when run from the command line but fails when running from a GNU parallel script, in this case the output is never shown and the parallel command never finishes.

Reinstalling 12.3.1 or 12.4.0 fixes the issue but using 12.5.0 or 12.6.0 fails consistently.

JuanC

@Trott Trott added the console Issues and PRs related to the console subsystem. label Jul 18, 2019
@targos
Copy link
Member

targos commented Jul 21, 2019

I don't have a Mac and I cannot reproduce on Linux.
I ran parallel node ::: test.js test.js with a console.log('test') in the test file and the output was printed.

@targos targos added the macos Issues and PRs related to the macOS platform / OSX. label Jul 21, 2019
@JuanCsfx
Copy link
Author

When I run parallel node ::: test.js test.js on my Mac I only get 1 output and the node process hangs. I noticed that if I run 6 test.js I get 5 outputs and the last node hangs so I tried this parallel --jobs 1 "sleep {}; echo {}" ::: 5 4 3 2 1 and I get the expected output, but if I run parallel --jobs 1 node ::: test.js test.js I get no output. The same command runs fine if I install 12.4.0

I also noticed that if use 2 js files that contain code that first calls console.log and then creates a file using fs.writeFileSync (which each js writing to a different file) and run it using the --jobs 1 parameter, I see not output but one of the files is created, so even though console.log does not generate any output the first script seems to continue executing but never finishes.

Let me know if there is any way I can help finding the issue.

@juanarbol
Copy link
Member

I'm getting two outputs using parallel and node 12.5.0, do you have other example for recreate this behaviour?

@JuanCsfx
Copy link
Author

test.js
console.log("Test")

test.txt

node console.js
node console.js
node console.js
node console.js

parallel --jobs 1 -a test.txt
No output, node process hangs, if I force quit process using Activity Monitor I get 4 outputs

parallel --jobs 2 -a test.txt
3 outputs, node process hangs, if I force quit process using Activity Monitor I get last output

It would seem as if in some scenarios, when parallel executes the process, node hangs reading/writing

I upgraded GNU parallel, I was using a 2015 build after using brew install parallel I am now using 20160722, same results.

Also upgraded MacOS from 10.14.5 to 10.14.6 same results in both versions.

These issues show up in both Node 12.5.0 and 12.6.0 but work as expected in 12.4.0

@targos
Copy link
Member

targos commented Jul 23, 2019

@nodejs/platform-macos Can somebody reproduce on a Mac?

@juanarbol
Copy link
Member

It's working fine on my machine, I'm using High Sierra

Screen Shot 2019-07-23 at 3 09 50 PM

@JuanCsfx
Copy link
Author

I cloned and built both v13.0.0-pre and v12.7.1-pre and it works as expected.
I then downloaded and installed v12.7.0 and it also works as expected.

I am not sure if this means 12.5.0 and 12.6.0 were actually broken at the source level or if the macOS installer (or build process) had an issue.

@richardlau
Copy link
Member

If it's mac only then it could be #28530, which was fixed by #28535 in 12.7.0 which would line up with the described results.

@targos
Copy link
Member

targos commented Jul 24, 2019

Thanks @richardlau. So this is resolved 🎉

@targos targos closed this as completed Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console Issues and PRs related to the console subsystem. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests

5 participants