-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
When I ran an application using google-cloud-spanner 1.30.0 with opencensus-impl 0.23.0, I noticed this log message:
io.opencensus.implcore.trace.RecordEventsSpanImpl finalize
SEVERE: Span CloudSpannerOperation.ExecuteStreamingQuery is GC'ed without being ended.
It looks like this is caused by the session keep-alive request:
Lines 790 to 796 in ca141fc
| private void keepAlive() { | |
| markUsed(); | |
| delegate | |
| .singleUse(TimestampBound.ofMaxStaleness(60, TimeUnit.SECONDS)) | |
| .executeQuery(Statement.newBuilder("SELECT 1").build()) | |
| .next(); | |
| } |
If I understand correctly, the ResultSet contains a ResumableStreamIterator, which contains the span representing the request. The issue is that keepAlive doesn't call close on the ResultSet, so the span is never ended. Calling close on the ResultSet seems to fix the issue.
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.