You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platform: Darwin Kernel Version 18.2.0: Fri Oct 5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64, Linux 4.15.0-29-generic Updates README with IRC channel for #io.js #31~16.04.1-Ubuntu SMP Wed Jul 18 08:54:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: Promise
I've found all versions of Node that I've tried hang after a long number of chained rejected Promises.
This script creates a large number of chained promises where each promise is added to the chain upon the previous promise being resolved.
If I run this script using this command (node promise.resolve.js && printf "exit: " && TZ=Zulu gdate -Ins) to track roughly the time it takes to run, I get these results:
Once again, the actual code completes in less than a second. However, the Node process continues to run for 48 seconds while hitting 100% CPU utilization for that period before finally exiting. The amount of time between finishing execution of the script and exiting the process grows in relation with the number of promises that are processed. (I started from 10 and increased the size of the requests array by magnitude until I reached the first number that caused a noticeable pause on my computer.)
This appears to be an issue with Node's implementation of Promise because this behavior is not exhibited when I add var Promise = require("bluebird"); at the top of the script.
The text was updated successfully, but these errors were encountered:
Version: v6.15.1, v8.14.0, v10.14.2, v11.4.0
Platform: Darwin Kernel Version 18.2.0: Fri Oct 5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64, Linux 4.15.0-29-generic Updates README with IRC channel for #io.js #31~16.04.1-Ubuntu SMP Wed Jul 18 08:54:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Subsystem: Promise
I've found all versions of Node that I've tried hang after a long number of chained rejected Promises.
This script creates a large number of chained promises where each promise is added to the chain upon the previous promise being resolved.
If I run this script using this command (
node promise.resolve.js && printf "exit: " && TZ=Zulu gdate -Ins
) to track roughly the time it takes to run, I get these results:Here we can see that it takes less than a second to run the actual code and the Node process quits very soon afterwards.
However, take this following script, which does basically the same thing as the last, but chains on Promise rejections rather than resolution.
After running the same command to roughly time its execution (
node promise.reject.js && printf "exit: " && TZ=Zulu gdate -Ins
), here are the results:Once again, the actual code completes in less than a second. However, the Node process continues to run for 48 seconds while hitting 100% CPU utilization for that period before finally exiting. The amount of time between finishing execution of the script and exiting the process grows in relation with the number of promises that are processed. (I started from 10 and increased the size of the
requests
array by magnitude until I reached the first number that caused a noticeable pause on my computer.)This appears to be an issue with Node's implementation of Promise because this behavior is not exhibited when I add
var Promise = require("bluebird");
at the top of the script.The text was updated successfully, but these errors were encountered: