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

Can simultaneous request override traceId ? #23

Closed
TbotaPhantA opened this issue Jun 10, 2022 · 3 comments
Closed

Can simultaneous request override traceId ? #23

TbotaPhantA opened this issue Jun 10, 2022 · 3 comments

Comments

@TbotaPhantA
Copy link

TbotaPhantA commented Jun 10, 2022

If two users will send 2 requests simultaneously:

  • first one will set traceId: some-uuid-1,
  • second one will set traceId: some-uuid-2,

then:

  • first one will log some-uuid-2 (but it should log some-uuid-1, becuase this is first request)
  • second one will log proper traceId some-uuid-2

Am I right or Am I wrong?

@techvlad
Copy link
Contributor

techvlad commented Oct 3, 2022

No, if this corner case is possible - that's bug in Node.js core, see https://nodejs.org/api/async_context.html#class-asynclocalstorage
nodejs/node#22360

@techvlad
Copy link
Contributor

techvlad commented Oct 3, 2022

This library is simple wrapper for AsyncLocalStorage

@TbotaPhantA
Copy link
Author

Got it, thank you😊!

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

No branches or pull requests

2 participants