You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(subscriber): ignore exiting spans that were never entered
Similarly, if we don't record entering a span due to event buffer
capacity, it doesn't make sense to record exiting it. This commit
changes the `ConsoleLayer` to only push a span to the current thread's
span stack if we were able to successfully send an `Enter` event to the
aggregator. This means that it won't be considered the parent span for
other events/spans. When a span is exited, we only send an `Exit` event
to the aggregator if the span *was* previously recorded as being entered.
In theory, ignoring subsequent events on spans that were dropped due to
buffer capacity technically means we are losing *more* data than we
would have if we did not ignore those spans. But, the data we are losing
here is *wrong*. For example, we cannot calculate a correct poll time
for a poll where we didn't record the beginning of the poll, and we only
recorded the poll ending. Therefore, I think it's better to ignore this
data than to make a half-assed attempt to record it even though we know
it's incorrect.
I believe this will probably also fix issue #180. That issue occurs
when we attempt to decrement the number of times a task has been
polled, and sometimes --- if an `enter` event for that task was missed
--- we may subtract more than we've added to the counter. By ignoring
exits for spans that we never recorded as entered, this panic should now
be avoided.
0 commit comments