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

[fix][txn]: fix some exception handle in transaction buffer #14808

Conversation

congbobo184
Copy link
Contributor

Motivation

fix some exception return in transaction buffer

Modifications

use exception.getCause();

Verifying this change

add test for it

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@congbobo184 congbobo184 added the type/bug The PR fixed a bug or issue reported a bug label Mar 23, 2022
@codelipenghui codelipenghui reopened this Mar 24, 2022
@@ -342,7 +342,7 @@ public void addFailed(ManagedLedgerException exception, Object ctx) {
}
}).exceptionally(exception -> {
log.error("Transaction {} abort on topic {}.", txnID.toString(), topic.getName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.error("Transaction {} abort on topic {}.", txnID.toString(), topic.getName());
log.error("Transaction {} abort on topic {}.", txnID.toString(), topic.getName(), exception.getCause());

@@ -296,7 +296,7 @@ public void addFailed(ManagedLedgerException exception, Object ctx) {
}
}).exceptionally(exception -> {
log.error("Transaction {} commit on topic {}.", txnID.toString(), topic.getName(), exception);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.error("Transaction {} commit on topic {}.", txnID.toString(), topic.getName(), exception);
log.error("Transaction {} commit on topic {}.", txnID.toString(), topic.getName(), exception.getCause());

@@ -218,7 +218,7 @@ public void recoverExceptionally(Exception e) {
}
}).exceptionally(exception -> {
log.error("Topic {}: TransactionBuffer recover failed", this.topic.getName(), exception);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.error("Topic {}: TransactionBuffer recover failed", this.topic.getName(), exception);
log.error("Topic {}: TransactionBuffer recover failed", this.topic.getName(), exception.getCause());

@codelipenghui codelipenghui merged commit 4824912 into apache:master Mar 24, 2022
codelipenghui pushed a commit that referenced this pull request Mar 25, 2022
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Mar 25, 2022
codelipenghui pushed a commit that referenced this pull request Apr 19, 2022
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/transaction cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 doc-not-needed Your PR changes do not impact docs release/2.9.3 release/2.10.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.

3 participants