GeezerVison is showing github.com — spanner: client library doesn’t handle a non-existent session error in all places · Issue #6422 · googleapis/google-cloud-java
spanner: client library doesn’t handle a non-existent session error in all places #6422Labels api: spannerIssues related to the Spanner API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DescriptionWe think that if the backend has closed the session, then the client is meant to create a new session and pass that to the user instead of letting this exception bubble up to the user.
WARNING: Error during call to readRow. [CONTEXT ratelimit_period="1 MINUTES" ]
com.google.cloud.spanner.SpannerException: NOT_FOUND: io.grpc.StatusRuntimeException: NOT_FOUND: Session not found: projects/<project>/instances/<instance>/databases/<database>/sessions/<session id>
resource_type: "type.googleapis.com/google.spanner.v1.Session"
resource_name: "projects/<project>/instances/<instance>/databases/<database>/sessions/<session id>"
description: "Session does not exist."
Activityskuruppu commented on Oct 3, 2019 ContributorAuthor More actions @sebright are you able to add the code which resulted in this error so that @olavloite can find the place if any changes need to be make to the error handling? sebright2 commented on Oct 3, 2019 The code that threw the exception read a single row, like this:
Struct row = databaseClient.singleUse().readRow(TABLE_NAME, Key.of(rowId), NON_KEY_COLUMNS);
added type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. on Oct 3, 2019olavloite commented on Oct 4, 2019 @sebright Is it possible that you used a somewhat older version of the client library? The automatic retry on SessionNotFoundException was added on May 13th 2019 so it's not that old, and it should also catch this condition. The test case here covers exactly this case.
If this happened while using a newer version of the client library: In that case it seems that this happened because the error was not recognized as a SessionNotFoundException by the client library (note the com.google.cloud.spanner.SpannerException prefix of the log item).
Do you have any more information about the exception than you gave above? From what I can see from the log information, that error should have been recognized, so I don't quite understand how this could have happened. sebright2 commented on Oct 5, 2019 @olavloite Great! I wasn't using the latest version, so I'll try upgrading to 1.41.0 and see if the issue disappears. sebright2 commented on Oct 7, 2019 I haven't seen the issue since upgrading to 1.41.0, so I'll close this issue. Thanks!
MetadataMetadataapi: spannerIssues related to the Spanner API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns. DevelopmentNo branches or pull requestsIssue actions
|