Skip to content

Conversation

arpan14
Copy link
Contributor

@arpan14 arpan14 commented Sep 26, 2023

Requests are made to wait till a session is available. We are introducing a session pool option acquireSessionTimeout and a public method setAcquireSessionTimeout in the SessionPoolOptions class that will allow to specify a timeout value for requests. Post this timeout application will receive a RESOURCE_EXHAUSTED error. If this option is not passed, the client library will wait for 60s by default.

  • Sample Usage
SessionPoolOptions sessionPoolOptions = SessionPoolOptions.newBuilder().setAcquireSessionTimeout(Duration.ofMillis(60)).build(); SpannerOptions.Builder builder = SpannerOptions.newBuilder() .setProjectId("my-project") .setChannelProvider(channelProvider) .setCredentials(NoCredentials.getInstance()) .setSessionPoolOption(sessionPoolOptions); 
@arpan14 arpan14 requested a review from a team as a code owner September 26, 2023 08:26
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/java-spanner API. labels Sep 26, 2023
@arpan14 arpan14 requested a review from olavloite September 26, 2023 08:30
arpan14 and others added 3 commits September 26, 2023 18:58
…ssionPoolOptions.java Co-authored-by: Knut Olav Løite <koloite@gmail.com>
…ssionPoolOptions.java Co-authored-by: Knut Olav Løite <koloite@gmail.com>
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Sep 26, 2023
@arpan14 arpan14 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Sep 26, 2023
arpan14 and others added 2 commits September 28, 2023 12:12
…ssionPoolOptions.java Co-authored-by: Knut Olav Løite <koloite@gmail.com>
@arpan14 arpan14 added owlbot:run Add this label to trigger the Owlbot post processor. and removed do not merge Indicates a pull request not ready for merge, due to either quality or timing. labels Sep 28, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Sep 28, 2023
@gcf-owl-bot gcf-owl-bot bot requested a review from a team as a code owner September 28, 2023 07:41
@arpan14 arpan14 merged commit 428e294 into googleapis:main Sep 28, 2023
@arpan14 arpan14 deleted the session-timeout-pr branch September 28, 2023 08:24
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. size: l Pull request size is large.