Skip to content

header_rewrite: reject bad run-plugin at config load#13425

Open
zwoop wants to merge 1 commit into
apache:masterfrom
zwoop:HRWRunPluginErrors
Open

header_rewrite: reject bad run-plugin at config load#13425
zwoop wants to merge 1 commit into
apache:masterfrom
zwoop:HRWRunPluginErrors

Conversation

@zwoop

@zwoop zwoop commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@zwoop zwoop added this to the 11.0.0 milestone Jul 24, 2026
@zwoop zwoop self-assigned this Jul 24, 2026
Copilot AI review requested due to automatic review settings July 24, 2026 21:42
@zwoop zwoop added the header_rewrite header_rewrite plugin label Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 bad run-plugin rules 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.

@zwoop

zwoop commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

[approve ci]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

header_rewrite header_rewrite plugin

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants