-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(spanner): fix invalid trace in case of skipping trailers #12235
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
Conversation
73c4223 to
0f717cc
Compare
afc0f0c to
2fe4f9f
Compare
2fe4f9f to
4b093a7
Compare
4b093a7 to
c1721bb
Compare
spanner/read.go
Outdated
| queueingUnretryable // 2 | ||
| aborted // 3 | ||
| finished // 4 | ||
| ended // 5 |
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.
I don't understand why we would need a separate status for this, and can't just use finished.
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.
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) |
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 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.
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.
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
Fixes: #12221
Internal Reference: go/golang-skip-trailer