You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/06/16 05:26:02 UTC

[GitHub] [flink] mayuehappy opened a new pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

mayuehappy opened a new pull request #16171:
URL: https://github.com/apache/flink/pull/16171


   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   
   fix the thread leak in RocksDBStateUploader
   
   ## Brief change log
   - name the thread group in RocksDBStateDataTransfer's ExecutorService
   - add `cleanUp()` in RocksDBSnapshotStrategyBase 
   - invoke` checkpointSnapshotStrategy.cleanUp()` when RocksDBKeyedStateBackend `dispose`
   - add test case `testDisposeCleanUpRocksDBStateDataTransferThread`  to Detected rocksDBStateDataTransfer thread leak
   
   ## Verifying this change
   
   This change added tests and can be verified as follows: 
   `testDisposeCleanUpRocksDBStateDataTransferThread`
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes)
     - The serializers: (no )
     - The runtime per-record code paths (performance sensitive): (no )
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? ( no)
     - If yes, how is the feature documented? (not applicable 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on a change in pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on a change in pull request #16171:
URL: https://github.com/apache/flink/pull/16171#discussion_r655241411



##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -238,6 +242,16 @@ public RocksDBKeyedStateBackendBuilder(
         return this;
     }
 
+    RocksDBKeyedStateBackendBuilder<K> setRocksDBStateUploader(
+            RocksDBStateUploader rocksDBStateUploader) {
+        Preconditions.checkState(

Review comment:
       thx very much . I also think it would be better to add this check




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-864336463


   @rkhachatryan Thx very much for your patience, I have updated the commit, PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173",
       "triggerID" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8c57a59392bf2c56235af42bb2847e2f34e7ad34 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150) 
   * d7f5803d01445fbdc7f006e00470ae45c677f3d3 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-864584456


   Hahahaha. . i have updated again @rkhachatryan  ( Perhaps this is why flink can always guarantee a relatively high code quality 👍 )


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173",
       "triggerID" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cd40d14f5cd45610616385098b0a35218915240",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3cd40d14f5cd45610616385098b0a35218915240",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d7f5803d01445fbdc7f006e00470ae45c677f3d3 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173) 
   * 3cd40d14f5cd45610616385098b0a35218915240 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rkhachatryan commented on a change in pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
rkhachatryan commented on a change in pull request #16171:
URL: https://github.com/apache/flink/pull/16171#discussion_r654542405



##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java
##########
@@ -142,6 +142,39 @@ public RocksIncrementalSnapshotStrategy(
         this.localDirectoryName = backendUID.toString().replaceAll("[\\-]", "");
     }
 
+    public RocksIncrementalSnapshotStrategy(

Review comment:
       Can we use telescopic constructor here?
   Or even better replace the old constructor with the new one, moving uploader creation to the outside?

##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/test/java/org/apache/flink/contrib/streaming/state/EmbeddedRocksDBStateBackendTest.java
##########
@@ -210,7 +211,7 @@ public void setupRocksKeyedStateBackend() throws Exception {
         testStreamFactory.setBlockerLatch(blocker);
         testStreamFactory.setWaiterLatch(waiter);
         testStreamFactory.setAfterNumberInvocations(10);
-
+        rocksDBStateUploader = spy(new RocksDBStateUploader(4));

Review comment:
       I think it's better to move `if enableIncrementalCheckpointing` check here from `verifyRocksDBStateUploaderClosed` so that the uploader isn't created unnecessarily.
   
   We could also use `RocksDBOptions.CHECKPOINT_TRANSFER_THREAD_NUM.defaultValue()` instead of `4` here.

##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -498,20 +505,36 @@ private RocksDBRestoreOperation getRocksDBRestoreOperation(
         RocksDBSnapshotStrategyBase<K, ?> checkpointSnapshotStrategy;
         if (enableIncrementalCheckpointing) {
             checkpointSnapshotStrategy =
-                    new RocksIncrementalSnapshotStrategy<>(
-                            db,
-                            rocksDBResourceGuard,
-                            keySerializerProvider.currentSchemaSerializer(),
-                            kvStateInformation,
-                            keyGroupRange,
-                            keyGroupPrefixBytes,
-                            localRecoveryConfig,
-                            cancelStreamRegistry,
-                            instanceBasePath,
-                            backendUID,
-                            materializedSstFiles,
-                            lastCompletedCheckpointId,
-                            numberOfTransferingThreads);
+                    injectRocksDBStateUploader != null
+                            ? new RocksIncrementalSnapshotStrategy<>(

Review comment:
       There are two fields now in builder: `injectRocksDBStateUploader` and `numberOfTransferingThreads`. But if the former is set then the latter is ignored.
   
   I think the more robust solution would be to  throw an exception in `setNumberOfTransferingThreads` if the uploader is not null. Otherwise, we'd have to close the old uploader, which is not something I'd expect from a builder setter method.
   
   WDYT?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173",
       "triggerID" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cd40d14f5cd45610616385098b0a35218915240",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3cd40d14f5cd45610616385098b0a35218915240",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5d04238ff94fdfc4b4d5beadf49dbc00c250099c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5d04238ff94fdfc4b4d5beadf49dbc00c250099c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d7f5803d01445fbdc7f006e00470ae45c677f3d3 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173) 
   * 3cd40d14f5cd45610616385098b0a35218915240 UNKNOWN
   * 5d04238ff94fdfc4b4d5beadf49dbc00c250099c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rkhachatryan merged pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
rkhachatryan merged pull request #16171:
URL: https://github.com/apache/flink/pull/16171


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rkhachatryan merged pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
rkhachatryan merged pull request #16171:
URL: https://github.com/apache/flink/pull/16171


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862052036


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 5d04238ff94fdfc4b4d5beadf49dbc00c250099c (Sat Aug 28 12:19:18 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    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 <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da7bdeeb228b36feb85493ecf24e21a36c551373 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8c57a59392bf2c56235af42bb2847e2f34e7ad34 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150) 
   * d7f5803d01445fbdc7f006e00470ae45c677f3d3 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173",
       "triggerID" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d7f5803d01445fbdc7f006e00470ae45c677f3d3 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on a change in pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on a change in pull request #16171:
URL: https://github.com/apache/flink/pull/16171#discussion_r654567336



##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/snapshot/RocksIncrementalSnapshotStrategy.java
##########
@@ -142,6 +142,39 @@ public RocksIncrementalSnapshotStrategy(
         this.localDirectoryName = backendUID.toString().replaceAll("[\\-]", "");
     }
 
+    public RocksIncrementalSnapshotStrategy(

Review comment:
       I also think that the construction of `RocksIncrementalSnapshotStrategy` and `uploader` is a little too tightly coupled, the current implementation is not so flexible. I try it separately.

##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -498,20 +505,36 @@ private RocksDBRestoreOperation getRocksDBRestoreOperation(
         RocksDBSnapshotStrategyBase<K, ?> checkpointSnapshotStrategy;
         if (enableIncrementalCheckpointing) {
             checkpointSnapshotStrategy =
-                    new RocksIncrementalSnapshotStrategy<>(
-                            db,
-                            rocksDBResourceGuard,
-                            keySerializerProvider.currentSchemaSerializer(),
-                            kvStateInformation,
-                            keyGroupRange,
-                            keyGroupPrefixBytes,
-                            localRecoveryConfig,
-                            cancelStreamRegistry,
-                            instanceBasePath,
-                            backendUID,
-                            materializedSstFiles,
-                            lastCompletedCheckpointId,
-                            numberOfTransferingThreads);
+                    injectRocksDBStateUploader != null
+                            ? new RocksIncrementalSnapshotStrategy<>(

Review comment:
       I think your ideas are more rigorous. please wait for my fix




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173",
       "triggerID" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cd40d14f5cd45610616385098b0a35218915240",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3cd40d14f5cd45610616385098b0a35218915240",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5d04238ff94fdfc4b4d5beadf49dbc00c250099c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19220",
       "triggerID" : "5d04238ff94fdfc4b4d5beadf49dbc00c250099c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d7f5803d01445fbdc7f006e00470ae45c677f3d3 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173) 
   * 3cd40d14f5cd45610616385098b0a35218915240 UNKNOWN
   * 5d04238ff94fdfc4b4d5beadf49dbc00c250099c Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19220) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-864924649


    Thanks again ,  i have squashed the commits and changed the name @rkhachatryan   : )


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-864924649


    Thanks again ,  i have squashed the commits and changed the name @rkhachatryan   : )


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-863938479


   @rkhachatryan Thanks again for your review . 
   i have drop the commit (363c912)  and the new `RocksDBStateUploader` was passed in TestCase (although it took some minor changes).
   After every use of `RocksDBKeyedStateBackend` that contains this `RocksDBStateUploader`, it will check whether `RocksDBStateUploader` has been closed
   can you re-review it if you got free time?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rkhachatryan commented on a change in pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
rkhachatryan commented on a change in pull request #16171:
URL: https://github.com/apache/flink/pull/16171#discussion_r655226389



##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -238,6 +242,16 @@ public RocksDBKeyedStateBackendBuilder(
         return this;
     }
 
+    RocksDBKeyedStateBackendBuilder<K> setRocksDBStateUploader(
+            RocksDBStateUploader rocksDBStateUploader) {
+        Preconditions.checkState(

Review comment:
       ```suggestion
           Preconditions.checkState(
                   injectRocksDBStateUploader == null, "rocksDBStateUploader can be only set once");
           Preconditions.checkState(
   ```
   I actually meant that the `rocksDBStateUploader` should be `null`, but checking `numberOfTransferingThreads` also makes sense)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19173",
       "triggerID" : "d7f5803d01445fbdc7f006e00470ae45c677f3d3",
       "triggerType" : "PUSH"
     }, {
       "hash" : "3cd40d14f5cd45610616385098b0a35218915240",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3cd40d14f5cd45610616385098b0a35218915240",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5d04238ff94fdfc4b4d5beadf49dbc00c250099c",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19220",
       "triggerID" : "5d04238ff94fdfc4b4d5beadf49dbc00c250099c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3cd40d14f5cd45610616385098b0a35218915240 UNKNOWN
   * 5d04238ff94fdfc4b4d5beadf49dbc00c250099c Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19220) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     }, {
       "hash" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19033",
       "triggerID" : "b32b5b91e5a8482d52bbb14ace29162d6fbd257f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19040",
       "triggerID" : "6c8eb37f9726103d3569e09fc098003db8742476",
       "triggerType" : "PUSH"
     }, {
       "hash" : "",
       "status" : "DELETED",
       "url" : "TBD",
       "triggerID" : "862878000",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19107",
       "triggerID" : "84f27809d42fcab5ef69cda22d7ca9cc05b4c962",
       "triggerType" : "PUSH"
     }, {
       "hash" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150",
       "triggerID" : "8c57a59392bf2c56235af42bb2847e2f34e7ad34",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8c57a59392bf2c56235af42bb2847e2f34e7ad34 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19150) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rkhachatryan commented on a change in pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
rkhachatryan commented on a change in pull request #16171:
URL: https://github.com/apache/flink/pull/16171#discussion_r655226389



##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -238,6 +242,16 @@ public RocksDBKeyedStateBackendBuilder(
         return this;
     }
 
+    RocksDBKeyedStateBackendBuilder<K> setRocksDBStateUploader(
+            RocksDBStateUploader rocksDBStateUploader) {
+        Preconditions.checkState(

Review comment:
       ```suggestion
           Preconditions.checkState(
                   injectRocksDBStateUploader == null, "rocksDBStateUploader can be only set once");
           Preconditions.checkState(
   ```
   I actually meant that the `rocksDBStateUploader` should be `null`, but checking `numberOfTransferingThreads` also makes sense)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] rkhachatryan commented on a change in pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
rkhachatryan commented on a change in pull request #16171:
URL: https://github.com/apache/flink/pull/16171#discussion_r654939097



##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -497,21 +507,25 @@ private RocksDBRestoreOperation getRocksDBRestoreOperation(
             long lastCompletedCheckpointId) {
         RocksDBSnapshotStrategyBase<K, ?> checkpointSnapshotStrategy;
         if (enableIncrementalCheckpointing) {
+            RocksDBStateUploader stateUploader =
+                    injectRocksDBStateUploader == null
+                            ? new RocksDBStateUploader(numberOfTransferingThreads)
+                            : injectRocksDBStateUploader;
             checkpointSnapshotStrategy =
                     new RocksIncrementalSnapshotStrategy<>(
-                            db,
-                            rocksDBResourceGuard,
-                            keySerializerProvider.currentSchemaSerializer(),
-                            kvStateInformation,
-                            keyGroupRange,
-                            keyGroupPrefixBytes,
-                            localRecoveryConfig,
-                            cancelStreamRegistry,
-                            instanceBasePath,
-                            backendUID,
-                            materializedSstFiles,
-                            lastCompletedCheckpointId,
-                            numberOfTransferingThreads);
+                                    db,
+                                    rocksDBResourceGuard,
+                                    keySerializerProvider.currentSchemaSerializer(),
+                                    kvStateInformation,
+                                    keyGroupRange,
+                                    keyGroupPrefixBytes,
+                                    localRecoveryConfig,
+                                    cancelStreamRegistry,
+                                    instanceBasePath,
+                                    backendUID,
+                                    materializedSstFiles,
+                                    lastCompletedCheckpointId)
+                            .setRocksDBStateUploader(stateUploader);

Review comment:
       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?

##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -238,6 +242,12 @@ public RocksDBKeyedStateBackendBuilder(
         return this;
     }
 
+    RocksDBKeyedStateBackendBuilder<K> setRocksDBStateUploader(
+            RocksDBStateUploader rocksDBStateUploader) {
+        this.injectRocksDBStateUploader = rocksDBStateUploader;

Review comment:
       Should we also have a similar here as in `setNumberOfTransferingThreads`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] mayuehappy commented on a change in pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
mayuehappy commented on a change in pull request #16171:
URL: https://github.com/apache/flink/pull/16171#discussion_r655241411



##########
File path: flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackendBuilder.java
##########
@@ -238,6 +242,16 @@ public RocksDBKeyedStateBackendBuilder(
         return this;
     }
 
+    RocksDBKeyedStateBackendBuilder<K> setRocksDBStateUploader(
+            RocksDBStateUploader rocksDBStateUploader) {
+        Preconditions.checkState(

Review comment:
       thx very much . I also think it would be better to add this check




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862052036


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit da7bdeeb228b36feb85493ecf24e21a36c551373 (Wed Jun 16 05:29:34 UTC 2021)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    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 <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #16171: [FLINK-22886][State Backends] fix Thread leak in RocksDBStateUploader

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #16171:
URL: https://github.com/apache/flink/pull/16171#issuecomment-862067374


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016",
       "triggerID" : "da7bdeeb228b36feb85493ecf24e21a36c551373",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * da7bdeeb228b36feb85493ecf24e21a36c551373 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=19016) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org