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

[Bug]: Invalid environment/flags from parent cause Workers to fail when using worker_threads #2075

Open
1 task done
aaronovz1 opened this issue Jul 19, 2023 · 3 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@aaronovz1
Copy link

Version

4.3

Platform

NodeJS

What happened?

Currently when using worker_threads and supplying an unsupported flag to the parent application, workers will throw. For example, when using --max-old-space-size the worker will fail with:

[ERR_WORKER_INVALID_EXEC_ARGV]: Initiated Worker with invalid execArgv flags: --max_old_space_size=1500

How to reproduce.

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@aaronovz1 aaronovz1 added the bug Something isn't working label Jul 19, 2023
@aaronovz1
Copy link
Author

Relevant node issue nodejs/node#41103

@manast
Copy link
Contributor

manast commented Jul 20, 2023

Ok. What would be the action to take from our side?

@aaronovz1
Copy link
Author

execArgv could be filtered or allowed to be passed from the user side instead of passing in the values from the parent/main process:

execArgv,

I managed to figure out this very dirty workaround for now though.
At the start of main() or before creating bullmq workers:
process.execArgv = process.execArgv.filter((arg) => !arg.includes("--max-old-space-size="));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants