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

Update async to version ^2.0.0 to prevent continuation-local-storage from loosing active context #2541

Closed
ghost opened this issue Jul 25, 2016 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 25, 2016

Part of the problems with Loopback context is because async and continuation-local-storage are used together under the hood. These two modules are known to have issues when used together.

When I ran this sample code with async 1.5.2, the active context is null within the 2nd callback of the async waterfall.
This issue was resolved however when I upgraded to async 2.0.0:
https://gist.github.com/marlonkjoseph/f42f3c71f746896a0d4b7279a34ea753

I believe upgrading the version of async on all Loopback modules should resolve the context issues.

@davidcheung
Copy link
Contributor

@marlonkjoseph thanks for your suggestion! good call
https://github.com/strongloop/loopback/pull/2577/files

@josieusa
Copy link

josieusa commented Aug 4, 2016

@marlonkjoseph Your premises are correct, but upgrading all modules in node_modules including loopback to async v2.0.0 did not solve the issue for me. Instead, I had more success with Node v6.3.1 and my own PR strongloop/loopback-context#2 locally, and I believe that it works thanks to its async-hook deep dependency (which requires a recent version of Node), but I need some more tests to be sure.

@davidcheung
Copy link
Contributor

thanks @josieusa
Closing this issue, I think discussion would be easier to keep track on the loopback-context side

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

No branches or pull requests

2 participants