Skip to content

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

Closed

Description

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.

Activity

  1. davidcheung commented on Aug 3, 2016

    @davidcheung
    Contributor
  2. josieusa commented on Aug 4, 2016

    @josieusa

    @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.

  3. davidcheung commented on Aug 4, 2016

    @davidcheung
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions