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

bluebird 2.9.14 hangs #534

Closed
ben-page opened this Issue Mar 19, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@ben-page
Contributor

ben-page commented Mar 19, 2015

Description

One of my applications started hanging after upgrading to 2.9.14 (on node v0.12.0). I've narrowed the issue to the change from setImmediate to nextTick.

Example

This is the simplest example I could come up with that reliably demonstrates the problem:

  1. git clone https://github.com/ben-page/bluebird-issue.git
  2. cd bluebird-issue
  3. npm install
  4. node index.js

If you run the code as is, it will hang. If you uncomment line 7 (to change the scheduler to setImmediate) or install bluebird 2.9.13, it will complete as expected.

Background

Honestly, I don't fully understand the problem, but I have found found several discussions that may be helpful. Apparently there are issues with race conditions or IO starvation related to nextTick.

nodejs/node-v0.x-archive#7996
http://blog.nodejs.org/2013/03/11/node-v0-10-0-stable/
nodejs/node-v0.x-archive#3335
https://groups.google.com/forum/#!topic/nodejs-dev/DvENgK8Nubw

@petkaantonov

This comment has been minimized.

Show comment
Hide comment
@petkaantonov

petkaantonov Mar 19, 2015

Owner

2.9.14 doesn't do anything but specifically change to using anything but nextTick, so I guess you could use 2.9.13?

Owner

petkaantonov commented Mar 19, 2015

2.9.14 doesn't do anything but specifically change to using anything but nextTick, so I guess you could use 2.9.13?

@ben-page

This comment has been minimized.

Show comment
Hide comment
@ben-page

ben-page Mar 19, 2015

Contributor

Yes, I can use 2.9.13.

Contributor

ben-page commented Mar 19, 2015

Yes, I can use 2.9.13.

@benjamingr

This comment has been minimized.

Show comment
Hide comment
@benjamingr

benjamingr Mar 25, 2015

Collaborator

@petkaantonov loves nextTick in node and how it's implemented :D

@ben-page you can use 2.9.14 and setScheduler if you'd like. The hanging is really odd though.

Collaborator

benjamingr commented Mar 25, 2015

@petkaantonov loves nextTick in node and how it's implemented :D

@ben-page you can use 2.9.14 and setScheduler if you'd like. The hanging is really odd though.

@ben-page

This comment has been minimized.

Show comment
Hide comment
@ben-page

ben-page Mar 26, 2015

Contributor

@benjamingr That's what I'm currently doing.

I'm not trying to say that bluebird shouldn't use nextTick, just that I've found an issue with its current usage. I don't understand the bluebird internals well enough to say whether the issue can be fixed in bluebird or if its fundamental to nextTick.

Contributor

ben-page commented Mar 26, 2015

@benjamingr That's what I'm currently doing.

I'm not trying to say that bluebird shouldn't use nextTick, just that I've found an issue with its current usage. I don't understand the bluebird internals well enough to say whether the issue can be fixed in bluebird or if its fundamental to nextTick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment