Conversation
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.
Which Issue(s) This PR Fixes
Brief Description
When broker initialization fails before the message store exists, shutdown attempts to persist delay offsets and throws the reported null-pointer exception while resolving their path. Resolving the path alone also permits an empty, uninitialized offset table to overwrite the primary file and its backup.
Resolve the path from the broker's store configuration and allow persistence only after delay offsets load successfully. Normal loading, slave synchronization loading and persistence share the same lock; a failed reload disables persistence until a successful load. Successfully loaded offsets can still be saved before scheduled delivery starts.
This addresses the shutdown exception and subsequent offset overwrite. It does not recover files already corrupted by a power interruption or establish the cause of the original initialization failure.
How Did You Test This Change?
BrokerInitializationFailureTest(9),ScheduleMessageServiceTest(4),BrokerControllerTest(5), andSlaveSynchronizeTest(3).{1:42}and backup offsets{1:40}across both shutdowns.git diff --checkpassed. Local JDK 21 execution used JaCoCo 0.8.12, Javassist 3.30.2-GA, Byte Buddy experimental support and JDK module opens, without POM changes.