question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AsyncLocalScopeManager uses static for an instance variable

See original GitHub issue
private static AsyncLocal<IScope> s_current = new AsyncLocal<IScope>();

If the user is using 2 tracers at the same time, both using an instance of AsyncLocalScopeManager underlying, then there is only 1 s_current shared between both of these tracers. I believe this was meant to be a private readonly variable rather than static.

It’s minor, but conceivable that composite tracers may hit this problem.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ndrwrbgscommented, May 7, 2018

I still don’t think that there should ever be multiple scope manager instances though.

I agree, but unless it’s impossible to do someone somewhere will do it and spend weeks debugging the errors 😄

I’ll work on tests and a change for it!

0reactions
cwe1sscommented, May 7, 2018

I’ll work on tests and a change for it!

👍 I’m looking forward to learn more about how AsyncLocal works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Is it possible to access an instance variable via a static ...
Yes, it is possible to access an instance variable from a static method without using a parameter but only if you can access...
Read more >
Java Program to Check the Accessibility of an Instance ...
Static variables in Java belong to the class i.e it is initialized only once at the start of the execution. By using static...
Read more >
Static Variables in Java – Why and How to Use ...
A static method means it can be called without creating an instance of the class. Static variables and methods in Java provide several ......
Read more >
Static in Java: An Overview of Static Keyword With Examples
When you create an object or instance for a class in Java, each object will have its own copy of the members such...
Read more >
Question - Static variables?
values the buttons use. Static variables are values where you only want one ever to exist. Regular variables mean that every time another...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found