-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid NPEs at ledger creation when DNS failures happen #7403
Conversation
@merlimat thank you for taking care of these places! |
}, LedgerMetadataUtils.buildAdditionalMetadataForCursor(name)); | ||
} catch (Throwable t) { | ||
log.error("[{}] Encountered unexpected error when creating cursor ledger", name, t); | ||
callback.operationFailed(new ManagedLedgerException(t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually I don't think we need this change here. The exception is already handled in ledger.asyncCreateLedger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. let me pull that back
* Avoid NPEs at ledger creation when DNS failures happen * Removed unnecessary try/catch (cherry picked from commit a230427)
* Avoid NPEs at ledger creation when DNS failures happen * Removed unnecessary try/catch
* Avoid NPEs at ledger creation when DNS failures happen * Removed unnecessary try/catch
* Avoid NPEs at ledger creation when DNS failures happen * Removed unnecessary try/catch (cherry picked from commit a230427)
* Avoid NPEs at ledger creation when DNS failures happen * Removed unnecessary try/catch
Motivation
As a followup to the fix in #7401, also use try/catch in all places where we're creating new ledgers to cover against NPEs triggered by DNS errors.