Repository navigation
Print exception stack trace when admin purge command fails - #4632
Merged
Merged
Conversation
dimas-b
approved these changes
Jun 9, 2026
dimas-b
left a comment
Contributor
There was a problem hiding this comment.
This fix LGTM 👍 Thanks, @vigneshio !
2 of 6 tasks
snazy
pushed a commit
that referenced
this pull request
Jun 10, 2026
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.
When the admin tool
purgecommand fails with an unexpected exception, it nowprints the exception stack trace to stderr before the generic error message,
matching the existing behavior of the
bootstrapcommand.Why
Previously the
catch (Exception e)block inPurgeCommandprinted only ageneric line - "Purge encountered errors during operation." - and discarded the
exception entirely. A failed purge (e.g. database connection failure, realm not
found, permission denied) gave operators zero diagnostic information, making
production issues hard to triage.
BootstrapCommandalready prints the stacktrace via
e.printStackTrace(spec.commandLine().getErr()); this change bringspurgein line with that convention.Changes
PurgeCommand: print the caught exception's stack trace to stderr in thefailure path.
PurgeCommandTestcovering the failure path: a stubMetaStoreManagerFactorywhosepurgeRealmsthrows, asserting stderr containsthe exception details and that the command returns
EXIT_CODE_PURGE_ERROR.CHANGELOG.md: added a Fixes entry.Testing
./gradlew :polaris-admin:test --tests "org.apache.polaris.admintool.PurgeCommandTest"- pass./gradlew :polaris-admin:spotlessCheck :polaris-admin:checkstyleMain :polaris-admin:checkstyleTest- pass./gradlew :polaris-admin:compileTestJava- passChecklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)