zookeeper_proxy: migrate config validation to exception free#46239
Merged
yanavlasov merged 1 commit intoJul 17, 2026
Merged
Conversation
Migrate the zookeeper_proxy network filter config factory from the throwing Common::FactoryBase to Common::ExceptionFreeFactoryBase, so config validation returns absl::StatusOr instead of throwing. The duplicated opcode and unknown opcode throws become absl::InvalidArgumentError with identical message text, and parseLatencyThresholdOverrides becomes a static helper whose parsed map is passed to the ZooKeeperFilterConfig constructor. The data plane was already exception free (envoyproxy#31485), so this finishes the filter and the directory entry is removed from the tools/code_format/config.yaml exception allowlist, locking the whole directory throw free via check_format. No behavior change. Part of envoyproxy#27412. Signed-off-by: David Vo <davidvo@lyft.com>
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
yanavlasov
approved these changes
Jul 17, 2026
Contributor
Author
|
/retest |
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.
The zookeeper_proxy network filter was one of the few remaining network filters whose config factory still threw
EnvoyExceptioninstead of returningabsl::StatusOr, which kept its whole directory on thetools/code_format/config.yamlexception allowlist and outside the no-throw check. This change switchesZooKeeperConfigFactoryfromCommon::FactoryBasetoCommon::ExceptionFreeFactoryBasesocreateFilterFactoryFromProtoTypedreturnsabsl::StatusOr<Network::FilterFactoryCb>, converts the two config-time throws (the duplicated-opcode check and the unknown-opcode lookup) toabsl::InvalidArgumentErrorwith byte-identical message text, and removes the zookeeper_proxy entry from the exception allowlist so check_format now enforces no-throw for the entire directory. The ZooKeeper filter's data plane was already made exception free in #31485; these two config-time throws were all that remained, so this finishes zookeeper_proxy specifically. It continues the exception-free migration tracked in #27412, following the same pattern as recently merged network-filter (#46111) and HTTP-filter (#46042) work.Commit Message: zookeeper_proxy: migrate config validation to exception free
Additional Description:
parseLatencyThresholdOverridesbecomes a public static helper returningabsl::StatusOr<LatencyThresholdOverrideMap>; the factory parses before constructingZooKeeperFilterConfig, whose constructor now takes the parsed map and can no longer fail.Risk Level: Low. Config-load-time only refactor with no data plane change; error messages and failure semantics are unchanged (
EnvoyExceptionbecomesabsl::InvalidArgumentErrorwith identical text, surfaced through the same config rejection path).Testing:
//test/extensions/filters/network/zookeeper_proxy:config_testand:filter_testpass in the CI clang docker image. The duplicated-opcode case was converted fromEXPECT_THROW_WITH_REGEXto a status matcher with the identical message substring; a newUnknownOpcodeInLatencyThresholdOverridestest calls the now-public static helper directly with an out-of-range opcode and assertsInvalidArgumentErrorwith the identical text, covering the error branch so per-directory coverage does not regress. filter_test's existing tests run unchanged through the updatedinitialize()helper.grep -rE 'throw|THROW'), and the allowlist entry is removed. Mutation proof: with the allowlist entry removed, injecting athrowinto filter.cc makescheck_formatfail with "Don't introduce throws into exception-free files"; at the parent commit the same injected throw passes, confirming the directory is now enforced.Docs Changes: N/A
Release Notes: N/A (internal refactor, no behavior change; matches the no-changelog precedent of #46111 and #46042)
Platform Specific Features: N/A
Part of #27412
Generative AI disclosure: Developed with AI assistance (Claude Code); I reviewed and understand every line and take full ownership of the submission.