Conversation
|
I don't see why it is a GC issue. |
|
I believe this comes down to inferred spans being created when the profiles are resolved, which could well be after the parent span has gone out of scope. It could use a more comprehensive fix since this could occur even not in tests, but we've not seen any issues and it seems rare enough that I think this is adequate Actually, I see that this can't be the case because we're using the span as the key, as you said. I'll think some more |
|
You're right, I've tried to work through all the possibilities I can think of
I can't find any mechanism that's causing the null. Obviously I've missed something because this is stack trace below. In any case, I think the change here is a valid workaround |
SylvainJuge
left a comment
There was a problem hiding this comment.
What is he effect of returning 0 here? Is this case already properly handled by callers of getAnchor method ?
The FixedClock always return 0 for this, so it's consistent with that. In production, this would cause the inferred child span to have the wrong timestamp (though correct duration). Given that this failure only occurs very rarely, and I suspect is a test setup race case rather than a real one (eg the test creates an inactive profiler but artificially sets it's profilingSessionOngoing to true), I think it's fine to run with. |
fixes #2429