vigneshio opened a new pull request, #4632:
URL: https://github.com/apache/polaris/pull/4632
When the admin tool `purge` command fails with an unexpected exception, it
now
prints the exception stack trace to stderr before the generic error message,
matching the existing behavior of the `bootstrap` command.
### Why
Previously the `catch (Exception e)` block in `PurgeCommand` printed only a
generic 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. `BootstrapCommand` already prints the stack
trace via `e.printStackTrace(spec.commandLine().getErr())`; this change
brings
`purge` in line with that convention.
### Changes
- `PurgeCommand`: print the caught exception's stack trace to stderr in the
failure path.
- Added `PurgeCommandTest` covering the failure path: a stub
`MetaStoreManagerFactory` whose `purgeRealms` throws, asserting stderr
contains
the 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` - pass
## Checklist
- [ ] ๐ก๏ธ Don't disclose security issues! (contact [email protected])
- [x] ๐ Clearly explained why the changes are needed, or linked related
issues: Fixes #
- [x] ๐งช Added/updated tests with good coverage, or manually tested (and
explained how)
- [ ] ๐ก Added comments for complex logic
- [x] ๐งพ Updated `CHANGELOG.md` (if needed)
- [ ] ๐ Updated documentation in `site/content/in-dev/unreleased` (if needed)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]