-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Tests] Fix thread leak in MLTransactionMetadataStore #14524
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
Conversation
|
@lordcheng10 Could this help in reducing memory consumption of branch-2.10 (v2.10.0-candidate-2) & master branch version? |
- MLTransactionMetadataStore.internalPinnedExecutor wasn't closed when MLTransactionMetadataStore.closeAsync was called - problem was introduced by apache#14238 changes - this issue causes tests to fail with OOME. Most likely this also impacts production code.
5821821 to
ceb3ff1
Compare
eolivelli
left a comment
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.
I left one suggestion PTAL
...src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
Outdated
Show resolved
Hide resolved
eolivelli
left a comment
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.
LGTM
|
btw. The thread leak is visible also in test output. #10195 added https://github.com/apache/pulsar/blob/master/buildtools/src/main/java/org/apache/pulsar/tests/ThreadLeakDetectorListener.java which logs threads that are active when the test ends. For example, when running this can be seen in the console: |
|
@codelipenghui Is the thread leak a blocker for 2.10 release? |
|
@lhotari Yes, this should be a blocker for 2.10.0 release, will cherry-pick this PR and start a new VOTE for 2.10.0 |
- MLTransactionMetadataStore.internalPinnedExecutor wasn't closed when MLTransactionMetadataStore.closeAsync was called - problem was introduced by #14238 changes - this issue causes tests to fail with OOME. Most likely this also impacts production code. * Close TransactionMetadataStoreService after the broker service has been closed (cherry picked from commit 0ddec86)
- MLTransactionMetadataStore.internalPinnedExecutor wasn't closed when MLTransactionMetadataStore.closeAsync was called - problem was introduced by #14238 changes - this issue causes tests to fail with OOME. Most likely this also impacts production code. * Close TransactionMetadataStoreService after the broker service has been closed (cherry picked from commit 0ddec86)
- MLTransactionMetadataStore.internalPinnedExecutor wasn't closed when MLTransactionMetadataStore.closeAsync was called - problem was introduced by apache#14238 changes - this issue causes tests to fail with OOME. Most likely this also impacts production code. * Close TransactionMetadataStoreService after the broker service has been closed
Motivation
MLTransactionMetadataStore.internalPinnedExecutor wasn't closed
when MLTransactionMetadataStore.closeAsync was called
this issue causes tests to fail with OOME. This might also impact
production code in some way.
example OOME in tests
Modifications
MoreExecutors.shutdownAndAwaitTerminationto handle ExecutorService shutdown since it handles shutdown in a proper way gracefully although in this case it seems that it would be fine to terminate forcefully by calling shutdownNow