fix(spanner): fix invalid trace in case of skipping trailers#12235
Merged
fix(spanner): fix invalid trace in case of skipping trailers#12235
Conversation
73c4223 to
0f717cc
Compare
afc0f0c to
2fe4f9f
Compare
2fe4f9f to
4b093a7
Compare
4b093a7 to
c1721bb
Compare
olavloite
requested changes
May 13, 2025
spanner/read.go
Outdated
| queueingUnretryable // 2 | ||
| aborted // 3 | ||
| finished // 4 | ||
| ended // 5 |
Contributor
There was a problem hiding this comment.
I don't understand why we would need a separate status for this, and can't just use finished.
Contributor
Author
There was a problem hiding this comment.
I added this to make sure we don't call cancel() while doing iter.Stop in case we saw the last message already
| } | ||
| } | ||
|
|
||
| }(d.stream) |
Contributor
There was a problem hiding this comment.
We should also call the cancel() method here (assuming that we set the reference to nil before this, so that iterator.Stop does not call it). That ensures that the context is marked as done.
Contributor
Author
There was a problem hiding this comment.
I have updated the code to not set cancel nil, but checking while stopping iter does not call cancel, and is it not always the case that context is marked as done after receiving io.EOF in GRPC?
9bceaff to
58833f1
Compare
58833f1 to
7fbd1a3
Compare
f8fd046 to
3d8f1d1
Compare
Modify a test to verify that the gRPC trace for a stream is not marked as cancelled when we return early after having received the Last flag.
3d8f1d1 to
d059fb9
Compare
b109e5c to
07afe7e
Compare
olavloite
approved these changes
May 13, 2025
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.
Fixes: #12221
Internal Reference: go/golang-skip-trailer