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
[Question] Scheduling issue with node ? #114
Comments
confirmed via testing the last snippet from the previous comment:
/cc @stefanpenner |
nextTick on node 0.10 has a serious bug for long chains between two different producers. the trade-off is extremely crappy :( |
Thanks for the reference. Do we have any other choice than the current implementation ? If not we should at least document that
(Note that 1 is actually 2 folds, <=0.9 Should I submit PRs to rsvp / es6-promise adding a "Known issues" section ? |
We can release a version without the work-around for the node 0.10 problem. In all honesty though node 0.10 is quite old, this problem has literally be fixed upstream for years. Seems like the bugfix is for people to upgrade to node 0.12 or later Ultimately, I can be convinced of taking either direction. |
If we can override the scheduler, we can pick a default behavior and make it easy to override it. |
We can resolve this one by:
|
sounds good, i may have time later this week. (thanks for the clear steps to resolve) |
I could try to draft something (most probably on Friday) but I'm not sure how to be able describe the issue accurately (i.e. interaction between different schedulers). Anyway, if you fell it could helpful for you to have something to start with/review let me know and I'll prepare this. |
note: the scheduler is now overridable -> #116 the question really is, should we sacrifice correctness for an edge case that only affects some users on node 10? e.g. should we just revert back to the previous mode. Especially if the schedule is overridable, they can always "work around it". |
My idea was to keep the current behavior and explain to node 10 users how they can update and the limitations |
seeems reasonable. |
@vicb @stefanpenner What's the workaround for node 0.10 users you are talking about? |
@vvo with node 0.10 es6-promises uses setImmediate() because We should indicate to users of this lib how to switch back to using |
@vicb thinking about this, i wonder if we should just move to nextTick always, and let the failure scenario happens. No other promise lib handles the failure case either. |
Not sure it's worth breaking BC for older systems ? |
i believe reverting that would merely restore it to be no worse then any other promise lib on that version of node |
Based on a comment from @jakearchibald.
Jack I had decided to look at the implementation for
setImmediate()
and took an other look at your comment:It seems wrong when I looked at it again this morning:
setImmediate()
should enqueue on the macrotask queue,.then()
should use the microtask queue,Now looking at the code again,
asap()
indeed usessetImmediate()
on node 0.10. So when run with node 0.10, the result ofwill be "1, 2, 3" which is not expected.
I'm unsure if there is a better way to enqueue a microtask with Node 0.10 (as
nextTick
could not be used according to the comment).If I'm right, this looks like an issue of ES6Promise ? if so it should probably be documented
edit: some background info on
process.nextTick()
- TL;DR: pre-0.9, it enqueues a macrotask.The text was updated successfully, but these errors were encountered: