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 silently exits with code 0, no error, when using a specific string for String.includes inside worker #107

Closed
RoyHP opened this issue Feb 10, 2021 · 5 comments

Comments

@RoyHP
Copy link

RoyHP commented Feb 10, 2021

Hey jasnell,

Node silently exits with code 0, no error, when using a specific string for String.includes inside worker. This happens during my call to await Promise.all(worker_promises) where worker_promises is an array of Piscina runTask() promises.

If you change it to a different string and run, it will exit normally producing full output.

I can give you my script to test with, but the problem is that it's designed to parse log file data from DDoS attacks (to count occurrences of requests matching certain patterns) and the dataset causing the issue is about 20GiB (1,186 gzipped log files). I can send it to you if you're okay with this.

Here are the two relevant sections of code and the output when it works:
Screen Shot 2021-02-10 at 6 08 44 PM
Screen Shot 2021-02-10 at 6 10 53 PM

Here are the two relevant sections of code and the output when it silently fails:
Screen Shot 2021-02-10 at 6 01 27 PM
Screen Shot 2021-02-10 at 6 02 02 PM

The dataset remains the same between runs and there are no other code changes.

I'm on node v14.15.5, macOS 11.2 x86

@RoyHP
Copy link
Author

RoyHP commented Feb 10, 2021

Also it fails the same way on v14.15.4. I noticed the stream/zlib fix in nodejs/node#36618 and wondered if it was related. Also fails in v12.20.1.

@RoyHP
Copy link
Author

RoyHP commented Feb 11, 2021

Note, it doesn't fail immediately but rather after processing a few hundred files.

@RoyHP
Copy link
Author

RoyHP commented Feb 11, 2021

So I found that it works if I comment out two console.log()'s that were trying to log a variable that doesn't exist... though it never gave me any errors about it.
Screen Shot 2021-02-10 at 7 55 12 PM

Could this console.log() have been somehow killing the worker threads and eventually it just stops and exits with 0 without continuing execution in main.js?

I apologize, it's just a quick and dirty script to get some insight into data.

@RoyHP RoyHP closed this as completed Feb 11, 2021
@mcollina
Copy link
Collaborator

I'm glad you solved your own problem!

@imcuttle
Copy link

emmm how to resolve it?

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

No branches or pull requests

3 participants