-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[ZK filter] Remove EnvoyException on data plane #30438
[ZK filter] Remove EnvoyException on data plane #30438
Conversation
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
/retest |
/retest |
Hi @JuniorHsu, please review whenever you have a chance, thanks! |
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 need more time to deliberate on the macro but put an immediate comment first
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
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.
let's try to reduce the number of macro
if macros are zk specific, probably introduce a enum
enum class ReportPolicy {
// comment
None,
// comment
DecodeError
}
then ReportPolicy
could be a parameter of macro
let's make ENVOY_LOG always happen in debug level if it applies
|
||
#define RETURN_INVALID_ARG_ERR_IF_STATUS_NOT_OK(status, message) \ | ||
if (!status.ok()) { \ | ||
return absl::InvalidArgumentError(message); \ |
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.
could we just return status
then we can save a pair of macros?
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.
If the function return type is absl::Status
, we could return status
directly.
If the function return type is absl::StatusOr<T>
, we cannot return status
directly, so I make it return absl::InvalidArgumentError
instead.
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
I tried, but had some issues. After adding the above enum, I converted the marcos sth like below
|
I was thinking
but seems to introduce more repetition. Let's not keep the dedicate macro for |
You mean "let's keep ..."? |
Yes 🤦 |
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
The PR is ready for review again, cc @JuniorHsu , thanks! |
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'm fine with this approach. Over to maintainers' round @mattklein123
…31245) This is the prerequisite of reverting #30438 in order to fix the ZK proxy filter "Uncaught Exception" issue. Risk Level: Low Testing: Unit test Docs Changes: Revert doc changes in #31138 Release Notes: Revert release notes in #31138 Platform Specific Features: N/A Signed-off-by: Zhewei Hu <zhu@pinterest.com>
Signed-off-by: Zhewei Hu <zhu@pinterest.com>
Commit Message: [ZK filter] Remove EnvoyException on data plane
Additional Description: The Envoy style guideline suggests "Exceptions are allowed on the control plane, though now discouraged in new code. Adding exceptions is disallowed on the data plane", details in #10878 and #27412. This diff tries to remove EnvoyException on the ZK proxy filter data plane and paves path for per-opcode decoder error metrics.
Risk Level: Low
Testing: Unit tests
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A