perf: Skip gRPC trailers for StreamingRead & ExecuteStreamingSql#3661
Merged
sakthivelmanii merged 1 commit intomainfrom Mar 17, 2025
Merged
perf: Skip gRPC trailers for StreamingRead & ExecuteStreamingSql#3661sakthivelmanii merged 1 commit intomainfrom
sakthivelmanii merged 1 commit intomainfrom
Conversation
olavloite
reviewed
Feb 26, 2025
| private TimeUnit streamWaitTimeoutUnit; | ||
| private long streamWaitTimeoutValue; | ||
| private SpannerException error; | ||
| private volatile boolean done; |
Collaborator
There was a problem hiding this comment.
I don't think this needs to be volatile. It will only be used by the gRPC thread that handles this stream. At least, that is if my assumption that onPartialResultSet and onCompleted are both only called by that thread.
Collaborator
Author
There was a problem hiding this comment.
I agree. atleast grpc threads will be accessing it sequentially not in parallel.
| .addValues(Value.int64Array(longArray).toProto()) | ||
| .setLast(false) | ||
| .build()); | ||
| assertThat(resultSet.next()).isTrue(); |
Collaborator
There was a problem hiding this comment.
nit: prefer the use of assertTrue and other junit assertions instead of com.google.truth.
| assertThrows( | ||
| SpannerException.class, | ||
| () -> { | ||
| assertThat(resultSet.next()).isFalse(); |
Collaborator
There was a problem hiding this comment.
How long does this take to execute?
Collaborator
Author
There was a problem hiding this comment.
977534f to
a2687ea
Compare
524bfb2 to
83534f6
Compare
83534f6 to
0f5c90c
Compare
olavloite
approved these changes
Mar 17, 2025
Closed
svc-squareup-copybara
pushed a commit
to cashapp/misk
that referenced
this pull request
Mar 24, 2025
| Package | Type | Package file | Manager | Update | Change | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-spanner](https://github.com/googleapis/java-spanner) | dependencies | misk/gradle/libs.versions.toml | gradle | minor | `6.88.0` -> `6.89.0` | | [com.google.cloud:google-cloud-datastore](https://github.com/googleapis/java-datastore) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.27.0` -> `2.27.1` | | [software.amazon.awssdk:sdk-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.4` -> `2.31.6` | | [software.amazon.awssdk:sqs](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.4` -> `2.31.6` | | [software.amazon.awssdk:dynamodb-enhanced](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.4` -> `2.31.6` | | [software.amazon.awssdk:dynamodb](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.4` -> `2.31.6` | | [software.amazon.awssdk:aws-core](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.4` -> `2.31.6` | | [software.amazon.awssdk:bom](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.4` -> `2.31.6` | | [software.amazon.awssdk:auth](https://aws.amazon.com/sdkforjava) | dependencies | misk/gradle/libs.versions.toml | gradle | patch | `2.31.4` -> `2.31.6` | --- ### Release Notes <details> <summary>googleapis/java-spanner (com.google.cloud:google-cloud-spanner)</summary> ### [`v6.89.0`](https://github.com/googleapis/java-spanner/blob/HEAD/CHANGELOG.md#6890-2025-03-20) ##### Features - Enable ALTS hard bound token in DirectPath ([#​3645](googleapis/java-spanner#3645)) ([42cc961](googleapis/java-spanner@42cc961)) - Next release from main branch is 6.89.0 ([#​3669](googleapis/java-spanner#3669)) ([7a8a29b](googleapis/java-spanner@7a8a29b)) - Support isolation level REPEATABLE_READ for R/W transactions ([#​3670](googleapis/java-spanner#3670)) ([e62f5ab](googleapis/java-spanner@e62f5ab)) ##### Bug Fixes - **deps:** Update the Java code generator (gapic-generator-java) to 2.55.1 ([b959f4c](googleapis/java-spanner@b959f4c)) - Revert the ALTS bound token enablement ([#​3679](googleapis/java-spanner#3679)) ([183c1f0](googleapis/java-spanner@183c1f0)) ##### Performance Improvements - Get database dialect using multiplexed session ([#​3684](googleapis/java-spanner#3684)) ([f641a40](googleapis/java-spanner@f641a40)) - Skip gRPC trailers for StreamingRead & ExecuteStreamingSql ([#​3661](googleapis/java-spanner#3661)) ([bd4b1f5](googleapis/java-spanner@bd4b1f5)) ##### Dependencies - Update dependency com.google.cloud:sdk-platform-java-config to v3.45.1 ([#​3689](googleapis/java-spanner#3689)) ([67188df](googleapis/java-spanner@67188df)) </details> <details> <summary>googleapis/java-datastore (com.google.cloud:google-cloud-datastore)</summary> ### [`v2.27.1`](https://github.com/googleapis/java-datastore/blob/HEAD/CHANGELOG.md#2271-2025-03-18) ##### Bug Fixes - **deps:** Update the Java code generator (gapic-generator-java) to 2.55.1 ([ba1ad98](googleapis/java-datastore@ba1ad98)) ##### Dependencies - Update dependency com.google.cloud:sdk-platform-java-config to v3.45.1 ([#​1791](googleapis/java-datastore#1791)) ([ab5ac8e](googleapis/java-datastore@ab5ac8e)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 6pm every weekday,before 2am every weekday" in timezone Australia/Melbourne, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). GitOrigin-RevId: 5b5b3e1fd7177ff56a483be663b20b28d243550c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes: b/394475581
Description:
gRPC trailers are headers which is usually sent after all the messages are sent by the server in the stream. Trailers usually causes additional latency of 250-300 μs after last message is sent in the stream. From the server, we will receiving last field which tells us about last PartialResultSet and we no longer will be waiting for trailers to assume that all the messages are received.
If you write sample code, please follow the samples format.