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

Use RELEASE_ASSERT instead of raise(SIGABRT) in kill_request filter #15999

Merged
merged 3 commits into from
Apr 19, 2021

Conversation

qqustc
Copy link
Contributor

@qqustc qqustc commented Apr 15, 2021

Commit Message: Use RELEASE_ASSERT instead of raise(SIGABRT) in kill_request filter to provide better logging when the filter is crashing Envoy.
Additional Description: N/A
Risk Level: low
Testing: unit test, integration test
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

/assign @antoniovicente

Copy link
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Looks good. I don't know what the format error is about.

@@ -81,7 +81,7 @@ Http::FilterHeadersStatus KillRequestFilter::encodeHeaders(Http::ResponseHeaderM

if (isKillRequest(headers) && isKillRequestEnabled()) {
// Crash Envoy.
raise(SIGABRT);
RELEASE_ASSERT(false, "KillRequestFilter is crashing Envoy!!!");
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we consider adding some EXPECT_DEATH tests that look for the message above when terminating the process due to use of this filter?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think these death tests are already there in the kill_request_filter_test.cc

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. My request is to change expectations like:
EXPECT_DEATH(filter_->decodeHeaders(request_headers_, false), "");
to:
EXPECT_DEATH(filter_->decodeHeaders(request_headers_, false), "KillRequestFilter is crashing Envoy!!!");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. Updated the test.

Copy link
Contributor

@antoniovicente antoniovicente left a comment

Choose a reason for hiding this comment

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

Thanks!

@antoniovicente antoniovicente merged commit 04b34ca into envoyproxy:main Apr 19, 2021
gokulnair pushed a commit to gokulnair/envoy that referenced this pull request May 6, 2021
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