opentracing-csharp icon indicating copy to clipboard operation
opentracing-csharp copied to clipboard

Managing Context across App Domains

Open notcool11 opened this issue 5 years ago • 1 comments

Ran into this issue recently in a Unit Test and uncovered a possible issue that could happen in production code: https://stackoverflow.com/questions/5439719/is-it-possible-to-use-the-logical-call-context-within-a-unit-test-in-vs-2010

Trying to keep the IScope around but it is not marked as either Serializable or MarshalByRefObject so it dies when being used across app domains. Likely the easy button is to mark it as Serializable, but I'm cool with whatever. Thanks.

notcool11 avatar Apr 13 '20 21:04 notcool11

This library only defines the interfaces and I don't think interfaces can be marked as Serializable so this is something that each tracer would have to implement. Also, AppDomains are no longer supported in .NET Core & .NET 5 onwards so I don't think this is something that's still important for this project (given that it's being replaced by OpenTelemetry).

I'll leave this open though to see if anyone else has an opinion on that.

cwe1ss avatar Dec 12 '20 15:12 cwe1ss