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

[WIP] fix(gRPC): retrieve status or biz error for non-ServerStreaming #1530

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

DMwangnima
Copy link
Contributor

@DMwangnima DMwangnima commented Sep 4, 2024

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional):
ClientStreaming 场景下,server 侧调用SendAndClose后,可能还会 return 一个 err,例如:

stream.SendAndClose(resp)
return status.Err(codes.Internal, "some err")

在当前的 client 侧,调用CloseAndRecv后,只能拿到resp,但拿不到这个 err。然而在官方 gRPC 中是可以拿到这个 err 的。
根本原因在于当前 Kitex 每次 Read 都只能解析一个 Frame,但实际上在 ClientStreaming 场景,这次 Read 不仅需要读 Data Frame,还需要读 Trailer Frame。

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@DMwangnima DMwangnima requested review from a team as code owners September 4, 2024 08:08
@DMwangnima DMwangnima changed the title fix(gRPC): retrieve status or biz error for non-ServerStreaming [WIP] fix(gRPC): retrieve status or biz error for non-ServerStreaming Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant