You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/02/20 19:43:31 UTC

[GitHub] [skywalking-nodejs] Qard commented on pull request #27: use invalid to check asyncState

Qard commented on pull request #27:
URL: https://github.com/apache/skywalking-nodejs/pull/27#issuecomment-782738884


   Just saw I was tagged in here. I just wanted to say, as the author of `store.enterWith(...)`, I highly recommend against using it in this way. It has one very specific use case, and is marked as such in the docs, which is to inject it before an http handler to have the entire remainder of the currently executing tick to be attributed to the given context. This is almost never what you actually want. In looking at how you're using it here, it should pretty much always be done with `store.run(...)` to properly escape the context attribution at the correct boundary. Otherwise you are likely to leak the context into places you might not expect or to switch contexts more than once in the same context which could also have strange behaviour.
   
   The official interface is `store.run(...)` and I would highly recommend only ever using that unless you are absolutely _certain_ `store.enterWith(...)` is the only solution and you fully understand the implications of using it.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org