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

ext_proc: Stop timers during ExternalProcessing::Filter::onDestroy #22541

Merged
merged 4 commits into from
Aug 12, 2022

Conversation

ristewar
Copy link
Contributor

@ristewar ristewar commented Aug 3, 2022

Signed-off-by: Rick Stewart ristewart@google.com

Commit Message: If a timer fires after onDestroy is called, the ext_proc filter may crash while trying to access invalid encoder or decoder filter callbacks. The documentation for StreamFilterBase::onDestroy() says, "Filters must not invoke either encoder or decoder filter callbacks after having onDestroy() invoked." envoy-security@googlegroups.com said it's OK to upstream this since ext_proc is marked alpha.

Additional Description:
Risk Level: Low
Testing: Unit tests added
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

If a timer fires after onDestroy is called, the ext_proc filter may crash while
trying to access invalid encoder or decoder filter callbacks. The documentation
for StreamFilterBase::onDestroy() says, "Filters must not invoke either
encoder or decoder filter callbacks after having onDestroy() invoked."

Signed-off-by: Rick Stewart <ristewart@google.com>
@ristewar ristewar requested a review from snowp as a code owner August 3, 2022 15:05
@ristewar
Copy link
Contributor Author

ristewar commented Aug 3, 2022

/assign @mpwarres @PiotrSikora

mpwarres
mpwarres previously approved these changes Aug 3, 2022
source/extensions/filters/http/ext_proc/processor_state.cc Outdated Show resolved Hide resolved
@mpwarres
Copy link
Contributor

mpwarres commented Aug 3, 2022

You might also consider adding a test case to ext_proc_integration_test.cc similar to ExtProcIntegrationTest.ResponseMessageTimeout, but with the added element that the downstream disconnects before time is advanced.

Signed-off-by: Rick Stewart <ristewart@google.com>
@ristewar
Copy link
Contributor Author

ristewar commented Aug 4, 2022

You might also consider adding a test case to ext_proc_integration_test.cc similar to ExtProcIntegrationTest.ResponseMessageTimeout, but with the added element that the downstream disconnects before time is advanced.

Done.

mpwarres
mpwarres previously approved these changes Aug 4, 2022
snowp
snowp previously approved these changes Aug 9, 2022
Copy link
Contributor

@snowp snowp 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! CI seems to be in a bad state, can you take a look?

Signed-off-by: Rick Stewart <ristewart@google.com>
@ristewar ristewar dismissed stale reviews from snowp and mpwarres via ec85f02 August 9, 2022 18:10
@ristewar
Copy link
Contributor Author

ristewar commented Aug 9, 2022

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Check envoy-presubmit didn't fail.

🐱

Caused by: a #22541 (comment) was created by @ristewar.

see: more, trace.

@ristewar
Copy link
Contributor Author

/retest

@repokitteh-read-only
Copy link

Retrying Azure Pipelines:
Retried failed jobs in: envoy-presubmit

🐱

Caused by: a #22541 (comment) was created by @ristewar.

see: more, trace.

…s_on_decode

Signed-off-by: Rick Stewart <ristewart@google.com>
@ristewar
Copy link
Contributor Author

LGTM, thanks! CI seems to be in a bad state, can you take a look?

Thanks! I fixed the tests.

@ristewar ristewar requested a review from snowp August 12, 2022 11:02
Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

Thanks!

@snowp snowp merged commit 073ed39 into envoyproxy:main Aug 12, 2022
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.

None yet

4 participants