Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spanner: ResultSet from session keep-alive request is not closed. #6330

Closed
sebright opened this issue Sep 24, 2019 · 0 comments · Fixed by #6331
Closed

Spanner: ResultSet from session keep-alive request is not closed. #6330

sebright opened this issue Sep 24, 2019 · 0 comments · Fixed by #6331
Assignees
Labels
api: spanner Issues related to the Spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@sebright
Copy link

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:

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.

sebright added a commit to sebright/google-cloud-java that referenced this issue Sep 24, 2019
Fixes googleapis#6330

Closing the ResultSet also closes the span associated with the keep-alive
request, which fixes a tracing issue.
@chingor13 chingor13 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: spanner Issues related to the Spanner API. labels Sep 25, 2019
@yoshi-automation yoshi-automation added triage me I really want to be triaged. and removed triage me I really want to be triaged. labels Sep 25, 2019
olavloite pushed a commit that referenced this issue Oct 2, 2019
Fixes #6330

Closing the ResultSet also closes the span associated with the keep-alive
request, which fixes a tracing issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the Spanner API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants