GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add gRPC-GCP channel pool as an option by nimf · Pull Request #1227 · googleapis/java-spanner

This repository was archived by the owner on Aug 30, 2026. It is now read-only.

Conversation

@nimf

@nimf nimf commented Jun 1, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This enables a user to opt-in for using the gRPC-GCP channel pool and configure its options.

For example:

    SpannerOptions.Builder optionsBuilder = SpannerOptions.newBuilder();

    // ...

    optionsBuilder.withGrpcGcpOptions(GcpManagedChannelOptions.newBuilder()
        .withResiliencyOptions(GcpResiliencyOptions.newBuilder()
            .setNotReadyFallback(true)
            .build())
        .build());

    Spanner spanner = optionsBuilder.build().getService();

The gRPC-GCP channel pool provides a couple resiliency improvements during some networking issues. It also provides additional channel pool metrics.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Jennnnny and others added 12 commits March 23, 2021 18:55
@Jennnnny
add grpc-gcp extensions
6b58a5a
@Jennnnny
remove local files
9e59de1
@Jennnnny
update read apiconfig
2349c47
@Jennnnny
update read apiconfig
e1c55d8
@Jennnnny
Add custom pool size for GCP extension
418da2b
@Jennnnny
add one more entry in aip config file
422302b
@Jennnnny
Merge branch 'master' into grpc-gcp
03815ca
@Jennnnny
change gcp package name
75bc079
@nimf
Adjust grpc-gcp package name and group
ea76c32
@nimf
Set grpc-gcp low streams watermark to 1
5d2afc8
This allows sessions to be spread across channels when the Spanner client starts up.
@nimf
Add gRPC-GCP extension options to SpannerOptions
76332de
@nimf
feat: add gRPC-GCP channel pool as an option
f8006c4
This enables a user to opt-in for using the gRPC-GCP extension channel pool and configure its options.
@nimf
nimf requested review from a team June 1, 2021 19:40
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the googleapis/java-spanner API. label Jun 1, 2021
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 1, 2021
@nimf
nimf marked this pull request as draft June 1, 2021 19:42
@nimf nimf changed the title Add gRPC-GCP channel pool as an option feat: add gRPC-GCP channel pool as an option Jun 1, 2021
thiagotnunes
thiagotnunes reviewed Jun 2, 2021
View reviewed changes
Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

olavloite
olavloite reviewed Jun 2, 2021
View reviewed changes
Comment thread google-cloud-spanner/src/main/resources/com/google/cloud/spanner/spi/v1/grpc-gcp-apiconfig.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-spanner/src/main/resources/com/google/cloud/spanner/spi/v1/grpc-gcp-apiconfig.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-spanner/src/main/resources/com/google/cloud/spanner/spi/v1/grpc-gcp-apiconfig.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

thiagotnunes pushed a commit to thiagotnunes/java-spanner that referenced this pull request Jun 5, 2021
@jsimonweb @thiagotnunes
samples: Add Cloud Spanner DML/PDML samples. (googleapis#1227)
475016c
@nimf
Addressed comments.
b6ccf7a
nimf
nimf commented Jun 13, 2021
View reviewed changes
Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nimf
Merge branch 'master' into grpc-gcp
549e2fd
# Conflicts:
#	google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java
#	google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java
@nimf
nimf marked this pull request as ready for review June 13, 2021 19:39
olavloite
olavloite reviewed Jun 14, 2021
View reviewed changes
Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerOptions.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread google-cloud-spanner/src/main/java/com/google/cloud/spanner/spi/v1/GapicSpannerRpc.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@olavloite

olavloite commented Jun 14, 2021

Copy link
Copy Markdown
Contributor

In order to fix the failed lint check you need to run the following command:

mvn com.coveo:fmt-maven-plugin:format
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nimf
Fixed linting issues.
6b94299
thiagotnunes
thiagotnunes reviewed Jun 14, 2021
View reviewed changes
Comment thread google-cloud-spanner/pom.xml
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>grpc-gcp</artifactId>
<version>1.0.0</version>

@thiagotnunes thiagotnunes Jun 14, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We tend to use the versions specified in java-shared-dependencies. By that, I mean we usually do NOT specify version dependencies (like here), but instead rely on the versions provided by the POM import of that repository.

Could we do the same for this artifact (if it is part of any BOMs specified in the shared dependencies)?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@nimf nimf Jun 16, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a part of any BOMs. If I add it to the java-shared-dependencies will all the projects depending on it automatically get grpc-gcp as a dependency or they must explicitly add it to their dependencies?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@thiagotnunes thiagotnunes Jun 21, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They must explicitly add it to their dependencies, but they won't need to specify a version. This makes sure that we are always using compatible library versions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@olavloite

olavloite commented Jun 15, 2021

Copy link
Copy Markdown
Contributor

Also, could we have a couple of tests for this feature that:

  1. Verifies that the creation of sessions is actually spread across multiple channels. See SessionClientTest for the current tests for the non-gRPC-GCP channel pool solution.
  2. An end-to-end test that enables this option and executes a couple of transactions to verify that enabling this option works (and continues to work in the future).
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nimf added 2 commits June 15, 2021 15:49
@nimf
Add integration test with enabled gRPC-GCP extension
ea82c12
@nimf
Remake gRPC-GCP extension related SpannerOptions
ed3d4ad
@nimf

nimf commented Jun 16, 2021

Copy link
Copy Markdown
Contributor Author

Also, could we have a couple of tests for this feature that:

  1. An end-to-end test that enables this option and executes a couple of transactions to verify that enabling this option works (and continues to work in the future).

Added.

  1. Verifies that the creation of sessions is actually spread across multiple channels. See SessionClientTest for the current tests for the non-gRPC-GCP channel pool solution.

For the GAX channel pool it is important which CHANNEL_HINT values the Spanner client uses so that every BatchCreateSession request uses different channel. And the SessionClientTest currently verifies that correct channel hints values are used. But the gRPC-GCP channel pool doesn't use channel hints. Instead these are the things required from the Spanner client to spread the sessions correctly:

  • Issue N+ BatchCreateSession requests (where N is the number of channels) (this is probably already tested)
  • Set up GAX with the pool size of 1
  • Set up low watermark for gRPC-GCP to 0

Can you give me a hint on how it is easier to test the last two, please?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olavloite

olavloite commented Jun 23, 2021

Copy link
Copy Markdown
Contributor

@nimf I can't push any changes to your branch, so I'll attach a proposal for a test as an attachment here. Please feel free to make any changes you think would be appropriate to the test.
ChannelUsageTest.java.txt

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nimf nimf mentioned this pull request Jun 23, 2021
feat: add grpc-gcp to dependencyManagement googleapis/java-shared-dependencies#389
Merged
@olavloite @nimf
Add ChannelUsageTest
2044798
@google-cla

google-cla Bot commented Jun 23, 2021

Copy link
Copy Markdown

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@google-cla google-cla Bot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Jun 23, 2021
@nimf

nimf commented Jun 23, 2021

Copy link
Copy Markdown
Contributor Author

@nimf I can't push any changes to your branch, so I'll attach a proposal for a test as an attachment here. Please feel free to make any changes you think would be appropriate to the test.
ChannelUsageTest.java.txt

Wow, it's perfect! Thank you so much!

I've added you as the author, but now it requires a consent. Can you give your consent, please?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gcf-merge-on-green Bot pushed a commit to googleapis/java-shared-dependencies that referenced this pull request Jun 23, 2021
@nimf
feat: add grpc-gcp to dependencyManagement (#389)
57fd2e6
Add gRPC-GCP extension library to shared dependencies.

This will be used by the Spanner client first: googleapis/java-spanner#1227
@thiagotnunes thiagotnunes added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jun 24, 2021
@olavloite

olavloite commented Jun 24, 2021

Copy link
Copy Markdown
Contributor

@googlebot I consent.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

olavloite
olavloite approved these changes Jun 24, 2021
View reviewed changes

@olavloite olavloite left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I assume the 1.0.0 version for the grpc-gcp in the pom.xml can be removed once the shared dependencies with this dependency included has been released (?)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nimf

nimf commented Jun 28, 2021

Copy link
Copy Markdown
Contributor Author

I assume the 1.0.0 version for the grpc-gcp in the pom.xml can be removed once the shared dependencies with this dependency included has been released (?)

Yes, exactly. I've already added grpc-gcp to the java-shared-dependencies but it hasn't been released yet.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@thiagotnunes thiagotnunes added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 29, 2021
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 29, 2021
@thiagotnunes
thiagotnunes merged commit 1fa95a9 into googleapis:master Jun 29, 2021
@skuruppu skuruppu mentioned this pull request Dec 2, 2021
Provision more channels with fewer sessions in each when using gRPC-GCP channel pool #1566
Closed
@vishwarajanand vishwarajanand mentioned this pull request Mar 9, 2023
fix(Spanner): add retry for RST_STREAM googleapis/google-cloud-php#5938
Merged
suztomo pushed a commit to googleapis/sdk-platform-java that referenced this pull request Mar 21, 2023
@nimf
feat: add grpc-gcp to dependencyManagement (#389)
475cbde
Add gRPC-GCP extension library to shared dependencies.

This will be used by the Spanner client first: googleapis/java-spanner#1227
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

2 more reviewers
@thiagotnunes thiagotnunes thiagotnunes left review comments
@olavloite olavloite olavloite approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: spanner Issues related to the googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@nimf @olavloite @thiagotnunes @yoshi-kokoro @Jennnnny
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.