Please sign in to comment.
worker: use copy of process.env
Instead of sharing the OS-backed store for all `process.env` instances, create a copy of `process.env` for every worker that is created. The copies do not interact. Native-addons do not see modifications to `process.env` from Worker threads, but child processes started from Workers do default to the Worker’s copy of `process.env`. This makes Workers behave like child processes as far as `process.env` is concerned, and an option corresponding to the `child_process` module’s `env` option is added to the constructor. Fixes: #24947 PR-URL: #26544 Reviewed-By: Ruben Bridgewater <email@example.com> Reviewed-By: Vse Mozhet Byt <firstname.lastname@example.org> Reviewed-By: Yongsheng Zhang <email@example.com> Reviewed-By: James M Snell <firstname.lastname@example.org> Reviewed-By: Benjamin Gruenbaum <email@example.com> Reviewed-By: Joyee Cheung <firstname.lastname@example.org> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
- Loading branch information...
Showing with 229 additions and 51 deletions.
- +14 −3 doc/api/process.md
- +40 −11 doc/api/worker_threads.md
- +24 −0 lib/internal/worker.js
- +2 −0 lib/worker_threads.js
- +4 −4 src/env-inl.h
- +1 −1 src/env.cc
- +5 −5 src/env.h
- +1 −1 src/node_credentials.cc
- +24 −25 src/node_env_var.cc
- +24 −1 src/node_worker.cc
- +4 −0 src/node_worker.h
- +32 −0 test/parallel/test-worker-process-env-shared.js
- +54 −0 test/parallel/test-worker-process-env.js
Oops, something went wrong.