sachinnn99 opened a new pull request, #10606: URL: https://github.com/apache/gravitino/pull/10606
### What changes were proposed in this pull request? Wrap the failure event dispatch in `TableEventDispatcher#createTable` with a nested try/catch so that a listener exception cannot replace the original `createTable` failure. The caught listener exception is logged at WARN level. ### Why are the changes needed? When `dispatcher.createTable()` throws and `eventBus.dispatchEvent(new CreateTableFailureEvent(...))` also throws (e.g. a listener fails), the listener exception replaces the original exception. This hides the root cause from callers and makes production failures harder to diagnose. Fix: #10597 ### Does this PR introduce _any_ user-facing change? No. The only behavioral change is that the original exception is now always preserved and rethrown, even if a failure event listener throws. ### How was this patch tested? Added a unit test (`testCreateTableFailureEventShouldNotMaskOriginalExceptionWhenListenerThrows`) in `TestTableEvent` that: 1. Mocks a `TableDispatcher` that throws on `createTable` 2. Registers a listener that throws on `CreateTableFailureEvent` 3. Asserts the original exception (not the listener's) is what surfaces All 13 tests in `TestTableEvent` pass. Formatted with `spotlessApply`. -- 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]
