Skip to content
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

Return nil from Server on stream shutdown #24

Merged

Conversation

moh-osman3
Copy link
Contributor

@moh-osman3 moh-osman3 commented Aug 24, 2023

Fixes #6

Applying learning from grpc/grpc-go#6504 (comment), which pointed out that the server is return EOF directly when the client calls CloseSend(), which is causing an error signal on spans.

Instead the server should check if it received EOF from client (indicating CloseSend() was called) and send StatusOK to the client. The client will know to restart the stream when it gets a response with batchID=-1 and status=OK.

@moh-osman3 moh-osman3 marked this pull request as ready for review August 24, 2023 17:46
@moh-osman3 moh-osman3 force-pushed the mohosman/server-return-ok-on-shutdown branch from 8a8ba7a to a4ca19f Compare August 29, 2023 05:15
Copy link
Contributor

@lquerel lquerel left a comment

Choose a reason for hiding this comment

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

LGTM

@moh-osman3 moh-osman3 requested a review from jmacd August 29, 2023 21:27
Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Contributor

@lquerel lquerel left a comment

Choose a reason for hiding this comment

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

I like the last changes around arrowpb.StatusCode_STREAM_SHUTDOWN
LGTM

@jmacd jmacd merged commit 53e682e into open-telemetry:main Aug 31, 2023
2 checks passed
jmacd pushed a commit that referenced this pull request Aug 31, 2023
After merging #24, unit
tests for otelarrowreceiver were failing and I did not catch that. This
PR fixes the unit tests by adding in support for an extra call to Send()
the receiver will do (with arrowpb.StatusCode_STREAM_SHUTDOWN), to
signal shutdown to the client.

Addresses
#29 (comment)
@jmacd jmacd mentioned this pull request Aug 31, 2023
jmacd added a commit that referenced this pull request Aug 31, 2023
Release v0.3.0 includes:
- #24
- #29 
- #30 
- #36 

This release includes a BREAKING CHANGE 🛑 🛑 🛑 🛑 🛑.
We do not anticipate another of these, it merely renames/enumbers status
codes to match the gRPC status code numbering scheme. However, since
status code 0 stays the same, it will result in unusual looking errors
but should be safe to deploy the receivers first. Their CANCELED (i.e.,
SERVER_SHUTDOWN) will read as UNAVAILABLE, etc.

See #27.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stream max-lifetime feature should ensure clean exit
3 participants