-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader #16171
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
[FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader #16171
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit 5d04238 (Sat Aug 28 12:19:18 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
b32b5b9
to
6c8eb37
Compare
@flinkbot run azure |
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.
Thanks for the PR @mayuehappy .
I noticed that CI failed after adding commits from two PRs. So I think it was a bad idea and it's better to have two separate PRs (#16168 with production changes and this one for tests). Sorry for the confusion.
Could you please drop its commit (363c912)?
I also have some minor remarks regarding the test, PTAL.
.../src/test/java/org/apache/flink/contrib/streaming/state/EmbeddedRocksDBStateBackendTest.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/flink/contrib/streaming/state/EmbeddedRocksDBStateBackendTest.java
Outdated
Show resolved
Hide resolved
6c8eb37
to
84f2780
Compare
@rkhachatryan Thanks again for your review . |
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.
Thanks for updating your PR @mayuehappy.
I've left some comments, PTAL.
...java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java
Outdated
Show resolved
Hide resolved
.../src/test/java/org/apache/flink/contrib/streaming/state/EmbeddedRocksDBStateBackendTest.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
Outdated
Show resolved
Hide resolved
84f2780
to
8c57a59
Compare
@rkhachatryan Thx very much for your patience, I have updated the commit, PTAL |
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.
Thanks a lot for updating the PR @mayuehappy !
I have a couple of more comments (sorry for nit-picking).
RocksDBKeyedStateBackendBuilder<K> setRocksDBStateUploader( | ||
RocksDBStateUploader rocksDBStateUploader) { | ||
this.injectRocksDBStateUploader = rocksDBStateUploader; |
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.
Should we also have a similar here as in setNumberOfTransferingThreads
?
lastCompletedCheckpointId) | ||
.setRocksDBStateUploader(stateUploader); |
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 think there is no need to introduce a setter in RocksIncrementalSnapshotStrategy
.
stateUploader
can be passed to its constructor and be a final field there (in fact, I think one of the benefits of having a builder is immutability of the object it builds).
WDYT?
Hahahaha. . i have updated again @rkhachatryan ( Perhaps this is why flink can always guarantee a relatively high code quality 👍 ) |
.../src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
Show resolved
Hide resolved
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.
Thanks for updating the PR @mayuehappy :) LGTM.
Could you please squash the commits (and change the component label in the commit message to tests
or state
).
I'd then merge it once the CI passes.
…talSnapshotStrategy
3cd40d1
to
5d04238
Compare
Thanks again , i have squashed the commits and changed the name @rkhachatryan : ) |
What is the purpose of the change
fix the thread leak in RocksDBStateUploader
Brief change log
cleanUp()
in RocksDBSnapshotStrategyBasecheckpointSnapshotStrategy.cleanUp()
when RocksDBKeyedStateBackenddispose
testDisposeCleanUpRocksDBStateDataTransferThread
to Detected rocksDBStateDataTransfer thread leakVerifying this change
This change added tests and can be verified as follows:
testDisposeCleanUpRocksDBStateDataTransferThread
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes)Documentation