Environment details
- Core/Tracing API
- OS type and version: Linux
- Java version: 1.8
- google-http-client version(s): 1.30.1
Steps to reproduce
- Just call
ServiceOptions.getDefaultProjectId() with opencensus Tracer enabled (I'm using Stackdriver). It apparently creates a span in com.google.api.client.http.HttpRequest.execute(), and throws inner exception `(UnknownHostException : metadata.google.internal) and forgetting to close span at this moment in the exception handler.
For my version of google http client this place:
catch (IOException e) {
if (!retryOnExecuteIOException
&& (ioExceptionHandler == null
|| !ioExceptionHandler.handleIOException(this, retryRequest))) {
throw e;
}
// Save the exception in case the retries do not work and we need to re-throw it later.
executeException = e;
if (loggable) {
logger.log(Level.WARNING, "exception thrown while executing request", e);
}
} finally {
ws.close();
}
- It also will be found by opencensus finalize afterwards:
Aug 10, 2019 7:45:59 PM io.opencensus.implcore.trace.RecordEventsSpanImpl finalize
SEVERE: Span Sent.com.google.api.client.http.HttpRequest.execute is GC'ed without being ended.
Code example
ServiceOptions.getDefaultProjectId()
Any additional information below
Environment details
Steps to reproduce
ServiceOptions.getDefaultProjectId()with opencensus Tracer enabled (I'm using Stackdriver). It apparently creates a span incom.google.api.client.http.HttpRequest.execute(), and throws inner exception `(UnknownHostException : metadata.google.internal) and forgetting to close span at this moment in the exception handler.For my version of google http client this place:
Code example
Any additional information below