-
Notifications
You must be signed in to change notification settings - Fork 892
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
Box FlightErrror::tonic
to reduce size (fixes nightly clippy)
#7229
Conversation
can you add a test that checks that, e.g. #[test]
fn test_error_size() {
assert_eq!(std::mem::size_of::<FlightError>(), 32);
} |
I took the liberty of adding this in 94da215 and pushed to this branch |
FlightErrror::tonic
to reduce size (fixes nightly clippy)
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.
Thank you @XiangpengHao @crepererum and @lewiszlw
I think this has been merged by mistake? Is main open for breaking changes yet? |
I forgot that, TBH I find it tiring to manually check the release schedule every time. Edit: filed #7268 to prevent future annoyance. |
…py) (apache#7229)" (apache#7266) This reverts commit f4fde76.
…py) (apache#7229)" (apache#7266) This reverts commit f4fde76.
Update:
|
Which issue does this PR close?
Closes #.
Rationale for this change
When working on the nightly rust, I noticed that clippy warns about
FlightError
too large, more than 176 bytes.I think it makes sense to keep the error small (32 bytes), as the Result<...> is used in a lot of places.
This PR basically makes
Tonic(tonic::Status)
intoTonic(Box<tonic::Status>)
, which reduces the FlightError from 176 bytes down to 32 bytes.This adds an extra allocation on error, but should probably be fine as it's not on hot path.
What changes are included in this PR?
Are there any user-facing changes?