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

feat(error): provide service name on the client side of gRPC #16254

Merged
merged 3 commits into from
Apr 12, 2024

Conversation

BugenZhao
Copy link
Member

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

In #13282, we introduced ServerError to be encoded inside the gRPC (HTTP) response and passed through the wire, so that the client could gain more information about the error occurred on the server. The most significant part is the service_name, so that we can know the target of the failing gRPC request.

However, [tonic::Status] is used for both client and server side. If there's something wrong with the server side and the error is directly created on the client side, the approach above is not applicable. In this case, the caller should set a "client side" service name to provide better error message. This is what this PR is for.

For example, run FLUSH after the meta node crashed:

ERROR:  Failed to run the query

Caused by these errors (recent errors listed first):
- 1: gRPC request failed: The service is currently unavailable
+ 1: gRPC request to meta service failed: The service is currently unavailable
  2: transport error
  3: error trying to connect
  4: tcp connect error
  5: Connection refused (os error 61)

We're able to know there's something wrong with the meta node in the error message.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@BugenZhao BugenZhao requested a review from a team as a code owner April 11, 2024 07:55
@BugenZhao
Copy link
Member Author

I don't find a way to test it in CI (except for simulation test). May go to #14700 / #14438.

Signed-off-by: Bugen Zhao <[email protected]>
Copy link
Member

@yezizp2012 yezizp2012 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

If there's something wrong with the server side

In your example, what went wrong?

@BugenZhao
Copy link
Member Author

If there's something wrong with the server side

In your example, what went wrong?

The meta node was killed and not reachable anymore.

@BugenZhao BugenZhao added this pull request to the merge queue Apr 12, 2024
Merged via the queue into main with commit 089a997 Apr 12, 2024
27 of 28 checks passed
@BugenZhao BugenZhao deleted the bz/rpc-error-client-side-service-name branch April 12, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants