-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
http1: remove exceptions from H/1 codec #11778
Conversation
Signed-off-by: Asra Ali <[email protected]>
/cc @yanavlasov |
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
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.
Looks like exception removal really is around the corner. That's really exciting.
What additional changes are needed to move this PR out of draft form?
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
I can move out of draft mode -- but this won't be ready to merge until we split the codecs to legacy versions. #10591 ^ That needs to basically be sync-ed every day (every codec change). We probably just want a target merge date for that PR, because it is taking way too much time for me to merge every couple days. |
Signed-off-by: Asra Ali <[email protected]>
Yeah... it would be good to merge that prerequisite PR. At this point we may want to wait until after the 1.16 branch split. |
Signed-off-by: Asra Ali <[email protected]>
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Asra Ali <[email protected]>
This is ready for review (and actual merge, since the split is ready) |
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Friendly ping? PTAL |
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.
LGTM to start testing with one small comment. Thanks for working on this!
/wait
// Make sure that dispatching_ is set to false after dispatching, even when | ||
// ConnectionImpl::dispatch throws an exception. |
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.
Should this comment be modified to talk about early return? I think this is why you still need this?
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.
Yes! modified
Signed-off-by: Asra Ali <[email protected]>
@antoniovicente @yanavlasov any other comments? otherwise will submit and submit a PR to lint for reintroducing throws in the new codecs. |
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
Commit Message:
Remove all throw statements from H/1 codec
Additional Description:
This change removed all uses of C++ exceptions from H/1 codec. I modeled the flow after Yan's H/2 work (#11575). Codec status are set in uniform helper methods. This is the only change from the previous PR (#11101), besides merging newer exceptions.
One of these was significant, that is the work done in
sendProtocolError
. This may runonMessageBeginBase()
, which may throw, so all calls tosendProtocolError
are wrapped inRETURN_IF_ERROR
. I was dubious about thesendLocalReply
inside this, but that callsResponseEncoder::encodeHeaders()
, which is safe.This change replaces all throw statements with a return of corresponding error Status and adds plumbing to return the status to codec callers. The dispatch() method returns the encountered error to the caller, which will be handled accordingly.
The calls to the RequestEncoder::encodeHeaders() NOT called from dispatch() method will RELEASE_ASSERT if an error code is returned. This does not alter the existing behavior of abnormally terminating the process, just the method of termination: RELEASE_ASSERT vs uncaught exception.
Risk Level: High (Codec changes)
Testing: Unit Tests
Docs Changes: N/A
Release Notes: N/A
Part of: #10878
Signed-off-by: Asra Ali [email protected]