Skip to content

[fix][storage]fix OpAddEntry release error when exception in ManagedLedgerInterceptor - #17394

Merged
AnonHxy merged 3 commits into
apache:masterfrom
HQebupt:releaseError
Sep 8, 2022
Merged

AnonHxy merged 3 commits into
apache:masterfrom
HQebupt:releaseError

Conversation

@HQebupt

@HQebupt HQebupt commented Sep 1, 2022

Copy link
Copy Markdown
Contributor

Motivation

There is a redundant releases in org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl#beforeAddEntry at line:853.
It will cause the error log as follows when there is an exception in ManagedLedgerInterceptor#beforeAddEntry.

 2022-09-01T16:07:04,851 - ERROR - [test-OrderedScheduler-1-0:SafeRunnable@38] - Unexpected throwable caught 
io.netty.util.IllegalReferenceCountException: refCnt: 0, decrement: 1
	at io.netty.util.internal.ReferenceCountUpdater.toLiveRealRefCnt(ReferenceCountUpdater.java:83) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
	at io.netty.util.internal.ReferenceCountUpdater.release(ReferenceCountUpdater.java:147) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
	at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:101) ~[netty-buffer-4.1.77.Final.jar:4.1.77.Final]
	at io.netty.util.ReferenceCountUtil.release(ReferenceCountUtil.java:90) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.beforeAddEntry(ManagedLedgerImpl.java:854) ~[classes/:?]
	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.internalAsyncAddEntry(ManagedLedgerImpl.java:774) ~[classes/:?]
	at org.apache.bookkeeper.mledger.impl.ManagedLedgerImpl.lambda$asyncAddEntry$4(ManagedLedgerImpl.java:769) ~[classes/:?]
	at org.apache.bookkeeper.mledger.util.SafeRun$1.safeRun(SafeRun.java:32) ~[classes/:?]
	at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) ~[bookkeeper-common-4.15.0.jar:4.15.0]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.77.Final.jar:4.1.77.Final]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

Modifications

  • Remove duplicate release in ManagedLedgerInterceptor

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

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

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • doc-not-needed

@HQebupt

HQebupt commented Sep 1, 2022

Copy link
Copy Markdown
Contributor Author

@HQebupt HQebupt changed the title [fix][ml]fix OpAddEntry release error when exception in ManagedLedgerInterceptor [fix][storage]fix OpAddEntry release error when exception in ManagedLedgerInterceptor Sep 1, 2022

@Jason918 Jason918 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch.
Left a minor suggestion.

@github-actions

github-actions Bot commented Sep 1, 2022

Copy link
Copy Markdown

@HQebupt Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@HQebupt

HQebupt commented Sep 1, 2022

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

3 similar comments
@HQebupt

HQebupt commented Sep 2, 2022

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@HQebupt

HQebupt commented Sep 2, 2022

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@HQebupt

HQebupt commented Sep 2, 2022

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@HQebupt

HQebupt commented Sep 2, 2022

Copy link
Copy Markdown
Contributor Author

@codelipenghui @Technoboy- PTAL, thanks in advance.

@HQebupt

HQebupt commented Sep 7, 2022

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@HQebupt

HQebupt commented Sep 7, 2022

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Sep 7, 2022
@AnonHxy
AnonHxy merged commit c6a1875 into apache:master Sep 8, 2022
@mattisonchao

Copy link
Copy Markdown
Member

It looks like we got many conflicts when cherry-picking it to branch-2.9.
Would you mind pushing a PR to branch-2.9? (To avoid cherry-picking involving bugs)

Technoboy- pushed a commit that referenced this pull request Sep 13, 2022
@Technoboy- Technoboy- modified the milestones: 2.12.0, 2.11.0 Sep 13, 2022
zymap pushed a commit that referenced this pull request Sep 15, 2022
@zymap zymap added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Sep 15, 2022
Jason918 pushed a commit that referenced this pull request Sep 26, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Sep 28, 2022
…edgerInterceptor (apache#17394)

(cherry picked from commit c6a1875)
(cherry picked from commit d17079a)
@HQebupt

HQebupt commented Oct 4, 2022 •

Copy link
Copy Markdown
Contributor Author

It looks like we got many conflicts when cherry-picking it to branch-2.9. Would you mind pushing a PR to branch-2.9? (To avoid cherry-picking involving bugs)

Sorry, I miss the message. PTAL #17929 @mattisonchao

congbobo184 pushed a commit that referenced this pull request Nov 14, 2022
…edgerInterceptor (#17929)

### Motivation
This PR is fully based on #17394.


### Modifications
- Remove duplicate release in `ManagedLedgerInterceptor`
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 14, 2022
congbobo184 pushed a commit that referenced this pull request Dec 7, 2022
…edgerInterceptor (#17929)

This PR is fully based on #17394.

- Remove duplicate release in `ManagedLedgerInterceptor`

(cherry picked from commit e6364bc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life cherry-picked/branch-2.10 cherry-picked/branch-2.11 doc-not-needed Your PR changes do not impact docs release/2.8.5 release/2.9.4 release/2.10.2 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.

8 participants