Skip to content

grpc: Refactor decode method#32676

Merged
htuch merged 19 commits intoenvoyproxy:mainfrom
tyxia:grpc_codec_client
Mar 29, 2024
Merged

grpc: Refactor decode method#32676
htuch merged 19 commits intoenvoyproxy:mainfrom
tyxia:grpc_codec_client

Conversation

@tyxia
Copy link
Copy Markdown
Member

@tyxia tyxia commented Mar 4, 2024

This PR is to improve the error status/code

In PR #32511, we introduce a max_frame_length feature (optional) . Now gRPC frame decoding can fail EITHER (1) due to decoding error OR (2) due to over-frame-limit error.

To better surface the error message, this PR refactor return type from bool to absl::status , so that the caller site can differentiate the error status. source/common/grpc/async_client_impl.cc in this PR can be an user example

tyxia added 10 commits February 22, 2024 03:10
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #32676 was opened by tyxia.

see: more, trace.

tyxia added 4 commits March 4, 2024 22:32
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
…codec_client

Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
@tyxia tyxia marked this pull request as ready for review March 6, 2024 21:45
@tyxia
Copy link
Copy Markdown
Member Author

tyxia commented Mar 6, 2024

/assign @yanavlasov @htuch

@tyxia tyxia marked this pull request as draft March 7, 2024 22:44
Copy link
Copy Markdown
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

Looks like a good approach. Please make in non-draft when it is ready for review

@tyxia tyxia marked this pull request as ready for review March 8, 2024 18:24
@tyxia
Copy link
Copy Markdown
Member Author

tyxia commented Mar 8, 2024

Looks like a good approach. Please make in non-draft when it is ready for review

Thank for review! This PR is ready for review. (I just temporarily marked it as draft to prioritize my other outstanding PRs, as this pr is for status code improvement)

I will reopen this PR once the other gRPC change is merged

@tyxia tyxia marked this pull request as draft March 8, 2024 18:59
@tyxia tyxia marked this pull request as ready for review March 11, 2024 14:04
Copy link
Copy Markdown
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

/wait-any

tyxia added 2 commits March 11, 2024 16:08
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
@tyxia
Copy link
Copy Markdown
Member Author

tyxia commented Mar 11, 2024

/retest

@tyxia
Copy link
Copy Markdown
Member Author

tyxia commented Mar 11, 2024

/wait

Add release note before submission

@tyxia
Copy link
Copy Markdown
Member Author

tyxia commented Mar 12, 2024

/retest

// inside the decoder.
std::vector<Grpc::Frame> frames;
decoder_.decode(data, frames);
std::ignore = decoder_.decode(data, frames);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should these turn into TODOs or bugs?

Copy link
Copy Markdown
Member Author

@tyxia tyxia Mar 27, 2024

Choose a reason for hiding this comment

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

TODOs is probably better?

I am hoping to leave it to filter owner to make the call and do the change accordingly @TAOXUY @nareddyt @lizan

Signed-off-by: tyxia <tyxia@google.com>
tyxia added 2 commits March 27, 2024 20:34
Signed-off-by: tyxia <tyxia@google.com>
Signed-off-by: tyxia <tyxia@google.com>
@yanavlasov
Copy link
Copy Markdown
Contributor

Waiting for final review from @htuch

/wait-any

Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@htuch htuch merged commit 77458ea into envoyproxy:main Mar 29, 2024
@tyxia tyxia deleted the grpc_codec_client branch April 1, 2024 21:26
alyssawilk pushed a commit to alyssawilk/envoy that referenced this pull request Apr 29, 2024
This PR is to improve the error status/code

In PR envoyproxy#32511, we introduce a max_frame_length feature (optional) . Now gRPC frame decoding can fail EITHER (1) due to decoding error OR (2) due to over-frame-limit error.

To better surface the error message, this PR refactor return type from bool to absl::status , so that the caller site can differentiate the error status. source/common/grpc/async_client_impl.cc in this PR can be an user example

Risk level: Low
Testing: Unit tests

Signed-off-by: tyxia <tyxia@google.com>
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.

3 participants