[fix][broker] Propagate topic policy initialization failures - #26259
Draft
Praveenkumar76 wants to merge 1 commit into
Draft
[fix][broker] Propagate topic policy initialization failures#26259Praveenkumar76 wants to merge 1 commit into
Praveenkumar76 wants to merge 1 commit into
Conversation
Praveenkumar76
force-pushed
the
fix/26137-topic-policy-load-failure
branch
from
August 1, 2026 06:41
b5987ce to
84bb5f1
Compare
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.
Fixes #26137
Motivation
Topic policy loading failures during topic initialization were being ignored for both persistent and non-persistent topics.
When
initTopicPolicy()failed, the initialization chain recovered throughexceptionally(...)and returned a successful result. This allowed the broker to expose a topic even though its topic-level policies had not been loaded. The topic could then operate using lower-priority namespace or broker-level policy values, which could result in incorrect enforcement and potential data loss.Topic initialization should fail when the initial topic policies cannot be loaded, instead of exposing a partially initialized topic.
Modifications
exceptionally(...)handlers inPersistentTopic.initialize()andNonPersistentTopic.initialize()withwhenComplete(...).isEncryptionRequiredset tofalsewhen persistent topic initialization fails.Verifying this change
This change added tests and can be verified as follows:
PersistentTopicTest.testInitializeFailsWhenTopicPolicyLoadingFails.NonPersistentTopicTest.testInitializeFailsWhenTopicPolicyLoadingFails.Does this pull request potentially affect one of the following parts: