Closed austinlparker closed 5 years ago
What happens to spans started or even finished after the tracer is closed is a good question. We have seen cases where async callbacks were executing and finishing spans even after the tracer was closed, so sometime the application does not have full control over that. Ie we were seeing crashes when the app was just shutting down.
There's a large number of possible states we need to consider.
The case of 'what happens if I try to start a span after closing a tracer' seems straightforward enough, the tracer should check to see if it's been closed. If it has been closed, an error occurs and the span is not created.
I don't really have a good idea about what happens to spans that are in-flight during the tracer being closed, however. Couple options -
There's probably others I haven't thought of.
If it has been closed, an error occurs and the span is not created.
that's not possible - methods for creating a span are not allowed to fail. You can return a noop-equivalent of a span.
what happens to spans that are in-flight
I think the required guarantee is that spans that have been Finished() prior to tracer.close() call must be flushed. Spans created or finished after tracer.close() may or may not be flushed, but should not be throwing errors and messing up the application.
lgtm
LGTM. Some details:
Close()
is undefined.@tedsuo, are you ok with deferring your question about if close should be synchronous so we can get this merged?
@austinlparker: yes, the RFC basically says that close is synchronous right now; I would just like that to be explicit. I doubt this is a contentious proposal.
Alright, I called that out specifically. Thanks!
This proposal builds off of discussions primarily in the Java API surrounding the inclusion of a Close method in that library. The primary goal of adding this to the specification is to provide a clean decoupling of OpenTracing
Tracer
s from their concrete implementations in a consistent way across platforms and languages.See https://github.com/opentracing/opentracing-java/issues/250 for further recent discussion.