-
-
Notifications
You must be signed in to change notification settings - Fork 40
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: Throat causes a halt in execution under certain conditions #61
Comments
We faced the same issue with this library. @ForbesLindesay please take a look at this - the library has a critical bug and it has 18m+ weekly downloads |
Can confirm and isolate this a bit more also without the chunking above. And yes the blocksize is the magic number 64 https://github.com/ForbesLindesay/throat/blob/master/index.js#L105 async function demoExitBug() {
const limitedConcurrency = throat(1);
for (let i = 0; i < 100; i += 1) {
console.log('working on', i);
await Promise.all([
limitedConcurrency(async () => true), // with just one it would complete
limitedConcurrency(async () => true), // concurrency + 1 = only 64 ok
// limitedConcurrency(async () => true), // concurrency + 2 = only 32 ok
]);
}
console.log('Done!'); // This will not be reached in 6.0.1
}
demoExitBug(); Looks like this was introduced in 6.0.1 8fd7a02#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R123 |
Throat has a significant unacknowledged bug (ForbesLindesay/throat#61) that may cause it to lock up with repeated invocations. Sindre's p-limit appears to be better supported. I picked p-limit 3.x (the last version before the switch to pure ESM) to match Jest's usage of other packages from Sindre. Fixes jestjs#12757
Sorry, didn't notice the issue. Pinging me on twitter is often good for super high priority issues like this. I'll push out a fix shortly. |
This is resolved in v6.0.2 |
Describe the bug
Throat causes a halt in execution under certain conditions
To Reproduce
This outputs:
Expected behaviour
Expected output:
Versions
Additional context
Messing around with the length of
pagesChunk
orsize
can make the script complete normally, or halt earlier or later in the iterations.The text was updated successfully, but these errors were encountered: