-
Notifications
You must be signed in to change notification settings - Fork 285
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
Mongodb breaks AsyncLocalStorage context spread #3186
Comments
I opened an issue here: https://jira.mongodb.org/browse/NODE-3010 but they said they won't fix it cause of the experimental nature of the feature. By the way, happens the same way with MariaDB driver when using callback API |
Interesting thanks for this link. cc @bengl @Qard @Flarna @rochdev in case you meet the issue in your APMs |
Hey @kas84 , In the meanwhile, you can also use One of the goal of AsyncLocalStorage as a standard core API is to push the ecosystem to become Async hooks friendly but there is still a bit of work to get there ^^ |
Hi @vdeturckheim thanks for the response! So that means I would have to bind it every time I use a mongodb callback, correct? Other way around it would be to monkeypatch mongoDB driver but I wouldn't be thrilled to do it. And for the most part, I use mongoDB streams API which doesn't work either but I think it would be the same fix... |
This is exactly the reason I brought up stabilizing these things in the first place. There seems to at least be consensus at this point that |
@Qard 💯 |
@kas84 I started to move forward with it nodejs/node#37675. |
Thanks @vdeturckheim, I will let the mongoDB team know when the PR gets merged. Let's hope they fix the driver! 🤞 |
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. |
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. |
I am having an issue using async hooks where the callback API of both mongodb and mariadb return undefined when used inside the callback (they work fine in the promise API though).
On mongodb when using useUnifiedTopology option set to true, sets the store correctly on the first run, but on subsequent requests, you still get the first store.
This is most likely a bug with their drivers, but, can somebody point me out in the right direction of what could be causing this?
I've built a sample app with mongodb: https://github.com/kas84/MongoDBCallbacksAsyncLocalStorage
The text was updated successfully, but these errors were encountered: