header_rewrite: reject bad run-plugin at config load#13425
Open
zwoop wants to merge 1 commit into
Open
Conversation
A run-plugin whose target plugin failed to load left a null instance that tripped a release assert and aborted the server on the first request. Propagate the load failure as an exception so the rule is rejected at config load time (a reload simply keeps the running config), and guard exec() so a stray bad rule can never abort the process.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the header_rewrite plugin’s run-plugin operator so that failures to load the target remap plugin are rejected during configuration load/reload rather than causing a TSReleaseAssert abort on first request. It also adds an AuTest gold test to prevent regressions and validate both cold-start and reload behavior.
Changes:
- Convert
OperatorRunPlugin::initialize()load failures into exceptions, so badrun-pluginrules are rejected during config parsing. - Catch operator initialization exceptions in
RuleSet::add_operator()and fail the ruleset cleanly with an error log. - Add a gold test covering both startup rejection and reload rejection while keeping the running config active.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/gold_tests/pluginTest/header_rewrite/header_rewrite_bad_run_plugin.test.py | Adds coverage ensuring a bad run-plugin is rejected at config load/reload and never crashes request processing. |
| plugins/header_rewrite/ruleset.cc | Catches Operator::initialize() exceptions so operator init failures reject the config cleanly. |
| plugins/header_rewrite/operators.cc | Makes run-plugin initialization throw on load failures and guards exec() against a null plugin instance. |
Contributor
Author
|
[approve ci] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A run-plugin whose target plugin failed to load left a null instance that tripped a release assert and aborted the server on the first request. Propagate the load failure as an exception so the rule is rejected at config load time (a reload simply keeps the running config), and guard exec() so a stray bad rule can never abort the process.