Skip to content
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

asap queue can be effectively overflown (using [email protected]) #55

Closed
xytis opened this issue Apr 2, 2015 · 2 comments · Fixed by #58
Closed

asap queue can be effectively overflown (using [email protected]) #55

xytis opened this issue Apr 2, 2015 · 2 comments · Fixed by #58

Comments

@xytis
Copy link

xytis commented Apr 2, 2015

Minimal example snippet:

"use strict";

var q = require("q");

var i;
var _handle = function (value) {
    console.log(value);
    return value;
};
for (i = 0; i < 1026; i++) {
    q(i).then(_handle).then(_handle);
}

Result (on my machine, 1026 loop iteration fails. I do not know if this is machine dependent)

/opt/socketeer/source/node_modules/q/node_modules/asap/asap.js:40
        this.task.call();
                  ^
TypeError: Cannot call method 'call' of null
    at RawTask.call (/opt/socketeer/source/node_modules/q/node_modules/asap/asap.js:40:19)
    at flush (/opt/socketeer/source/node_modules/q/node_modules/asap/raw.js:50:29)
    at process._tickCallback (node.js:415:13)

node version: v0.10.25

@kriskowal
Copy link
Owner

Pull requests welcome. I am eager to enable contributors to join this project.

@ForbesLindesay
Copy link
Collaborator

I've marked [email protected], 2.0.1 and 2.0.2 as deprecated with a message of "critical race condition fixed in 2.0.3, update now". Hopefully that will keep people from using the broken versions too often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants