| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
fix: nodejs#42523 Problem: If no platform worker exists, Node.js doesn't shut down when background tasks exist. It keeps waiting in `NodePlatform::DrainTasks`. Observation: It seems that Node.js used to use V8's `DefaultPlatform` implementation, which chooses a suitable default value in case that `--v8-pool-size=0` is given as a command-line option. However, Node.js currently uses its own v8::Platform implementation, `NodePlatform`. It doesn't have the logic to handle the case. I referred to nodejs#4344 to track the issue.
| if (uv_cpu_info(&cpu_info, &count) == 0) { | ||
| uv_free_cpu_info(cpu_info, count); | ||
| thread_pool_size = count - 1; | ||
| } | ||
| } |
There was a problem hiding this comment.
I suggest waiting for the upgrade to libuv 1.44 and replacing this with uv_available_parallelism(), it's specifically for use cases such as this one.
uv_cpu_info() isn't really appropriate because it doesn't know how many processors are available to the process, only how many are online.
Sorry, something went wrong.
There was a problem hiding this comment.
uv_available_parallelism() looks more suited to this case indeed. I'll wait for the upgrade to land.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Resolved: #42523
Problem:
If no platform worker exists, Node.js doesn't shut down when background
tasks scheduled exist. It keeps waiting in NodePlatform::DrainTasks.
Observation:
It seems that Node.js used V8's DefaultPlatform implementation a long
time ago, which chooses a suitable default value in case --v8-pool-size=0
is given as a command-line option. However, Node.js currently uses its
own v8::Platform implementation, NodePlatform. It seems not to have
the logic to handle the case.
I referred to #4344 to track the issue.