question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RangeError when using queue with 5000+ tasks.

See original GitHub issue

I have made a pull request with a test that fails. https://github.com/caolan/async/pull/509

RangeError Maximum call stack size exceeded

It is basicaly this

var q = async.queue(function(task,cb) { cb(); })
q.pause();

for (var i=0; i< 5000; i++) {
  q.push({ index: i });
}

q.resume();

When cb is called there can be RangeError’s I don’t know enough to figure out why though.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
caolancommented, Apr 15, 2014

You need to call cb() asynchronously. Try setImmediate(cb) instead.

0reactions
bishopZcommented, Apr 23, 2014

Btw, Frame.js v2 resolved this issue. https://github.com/bishopZ/Frame.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

nodeJs huge array processing throws RangeError: Maximum ...
The problem is that you are making to many function calls. Setting the stack-size to a higher value will only increase the number...
Read more >
JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >
A mostly complete guide to error handling in JavaScript.
Learn how to deal with errors and exceptions in synchronous and asynchronous JavaScript code.
Read more >
The Stack in Magic and JavaScript | by Pascal van Leeuwen
In computing, it is a data structure where data and tasks are ... it is pushed to the callback queue and will resolve...
Read more >
xrtlibrary-async - npm
Start using xrtlibrary-async in your project by running `npm i ... strictMode (Boolean): True if a task function must return with a Promise...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found