Skip to content
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

Merged
merged 2 commits into from
Jul 1, 2020

Conversation

merlimat
Copy link
Contributor

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.

@merlimat merlimat added type/bug The PR fixed a bug or issue reported a bug release/2.5.3 release/2.6.1 labels Jun 30, 2020
@merlimat merlimat added this to the 2.7.0 milestone Jun 30, 2020
@merlimat merlimat self-assigned this Jun 30, 2020
@sijie
Copy link
Member

sijie commented Jun 30, 2020

@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));
Copy link
Member

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

Copy link
Contributor Author

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

@merlimat merlimat merged commit a230427 into apache:master Jul 1, 2020
@merlimat merlimat deleted the fix-npe-create-ledger branch July 1, 2020 01:41
codelipenghui pushed a commit to streamnative/pulsar-archived that referenced this pull request Jul 14, 2020
* Avoid NPEs at ledger creation when DNS failures happen

* Removed unnecessary try/catch

(cherry picked from commit a230427)
cdbartholomew pushed a commit to kafkaesque-io/pulsar that referenced this pull request Jul 21, 2020
* Avoid NPEs at ledger creation when DNS failures happen

* Removed unnecessary try/catch
cdbartholomew pushed a commit to kafkaesque-io/pulsar that referenced this pull request Jul 24, 2020
* Avoid NPEs at ledger creation when DNS failures happen

* Removed unnecessary try/catch
wolfstudy pushed a commit that referenced this pull request Jul 29, 2020
* Avoid NPEs at ledger creation when DNS failures happen

* Removed unnecessary try/catch

(cherry picked from commit a230427)
huangdx0726 pushed a commit to huangdx0726/pulsar that referenced this pull request Aug 24, 2020
* Avoid NPEs at ledger creation when DNS failures happen

* Removed unnecessary try/catch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/2.5.3 release/2.6.1 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants