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

bluebird 2.9.14 hangs #534

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

bluebird 2.9.14 hangs #534

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

Comments

@ben-page
Copy link
Contributor

@ben-page 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
Copy link
Owner

@petkaantonov 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
Copy link
Contributor Author

@ben-page ben-page commented Mar 19, 2015

Yes, I can use 2.9.13.

@benjamingr
Copy link
Collaborator

@benjamingr 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
Copy link
Contributor Author

@ben-page 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.