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

Disabling retries by setting retryableCodes to empty Set doesn't stop from retrying #3306

Open
patrykwoj91 opened this issue Aug 27, 2024 · 0 comments
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API.

Comments

@patrykwoj91
Copy link

patrykwoj91 commented Aug 27, 2024

Hello,
I am using google-cloud-spanner 6.69.0 for java. I am trying to disable retry mechanism for :

com.google.cloud.spanner.SpannerException: UNAVAILABLE: io.grpc.StatusRuntimeException: UNAVAILABLE: io exception - Statement: 'SELECT 1'

To do that I have followed the documentation, and set:

SpannerOptions.Builder spannerOptionsBuilder = SpannerOptions.newBuilder(); 

spannerOptionsBuilder.getSpannerStubSettingsBuilder().streamingReadSettings().setRetryableCodes(Collections.emptySet());        

spannerOptionsBuilder.getSpannerStubSettingsBuilder().executeStreamingSqlSettings().setRetryableCodes(Collections.emptySet());

However, this doesn't seem to have a valid effect because in the retrying loop:

method isRetryable is defined as follows:

boolean isRetryable(SpannerException spannerException) {
    return spannerException.isRetryable()
        || retryableCodes.contains(
            GrpcStatusCode.of(spannerException.getErrorCode().getGrpcStatusCode()).getCode());
  }

which basically ignores retryableCodes setting, as long as exception itself is marked as retryable.

Not sure if this is a bug or intended behavior, but this still causes the retries to happen, despite setting retryableCodes to empty.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Aug 27, 2024
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 googleapis/java-spanner API.
Projects
None yet
Development

No branches or pull requests

2 participants