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 2020/08/31 13:17:45 UTC

[GitHub] [flink] rkhachatryan opened a new pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

rkhachatryan opened a new pull request #13286:
URL: https://github.com/apache/flink/pull/13286


   ## What is the purpose of the change
   
   This is a follow up fix for #13267:
   On close, `SubtaskCheckpointCoordinator` "collects" runnables to close under the lock,
   but it actually closes them outside of the synchronized section.
   Therefore, runnable can observe `coord.isClosed && runnable.isRunning` state and throws an exception.
   
   This PR replaces 'asyncCheckpointRunnable.isRunning()` check with `!checkpoints.containsKey(checkpointId)`.
   
   ## Verifying this change
   
   This change is a trivial rework without any test coverage.
   
   ## 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)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager no, 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? no
   


----------------------------------------------------------------
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] zhijiangW commented on a change in pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -366,11 +366,10 @@ private void registerAsyncCheckpointRunnable(long checkpointId, AsyncCheckpointR
 		synchronized (lock) {
 			if (closed) {
 				LOG.debug("Cannot register Closeable, this subtaskCheckpointCoordinator is already closed. Closing argument.");
-				final boolean running = asyncCheckpointRunnable.isRunning();
 				closeQuietly(asyncCheckpointRunnable);
 				checkState(
-					!running,

Review comment:
       I am a bit torn whether it deserves somehow UT or ITCase for the changes.
   It seems not bad to be covered by existing E2E tests, so I am fine with you final judgement here.




----------------------------------------------------------------
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] zhijiangW commented on a change in pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -366,11 +366,10 @@ private void registerAsyncCheckpointRunnable(long checkpointId, AsyncCheckpointR
 		synchronized (lock) {
 			if (closed) {
 				LOG.debug("Cannot register Closeable, this subtaskCheckpointCoordinator is already closed. Closing argument.");
-				final boolean running = asyncCheckpointRunnable.isRunning();
 				closeQuietly(asyncCheckpointRunnable);
 				checkState(
-					!running,

Review comment:
       In the past we might encounter unnecessary exception while `#registerAsyncCheckpointRunnable` and `AsyncCheckpointRunnable#close` execute concurrently. Now we only close the runnable quietly without throwing any exception for `closed` case.
   
   I agree with this fix, but do we have any existing ITCase for covering/verifying this change?




----------------------------------------------------------------
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 #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016",
       "triggerID" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 358ebf0c0aaffb505bc95a97d6133183ec749d7a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016) 
   
   <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 commented on pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   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 358ebf0c0aaffb505bc95a97d6133183ec749d7a (Mon Aug 31 13:19:33 UTC 2020)
   
   **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] rkhachatryan commented on a change in pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -366,11 +366,10 @@ private void registerAsyncCheckpointRunnable(long checkpointId, AsyncCheckpointR
 		synchronized (lock) {
 			if (closed) {
 				LOG.debug("Cannot register Closeable, this subtaskCheckpointCoordinator is already closed. Closing argument.");
-				final boolean running = asyncCheckpointRunnable.isRunning();
 				closeQuietly(asyncCheckpointRunnable);
 				checkState(
-					!running,

Review comment:
       I think there are no ITCases covering this, but some existing end-to-end tests indirectly cover this.




----------------------------------------------------------------
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] zhijiangW merged pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   


----------------------------------------------------------------
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 #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016",
       "triggerID" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 358ebf0c0aaffb505bc95a97d6133183ec749d7a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016) 
   
   <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] zhijiangW commented on a change in pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -366,11 +366,10 @@ private void registerAsyncCheckpointRunnable(long checkpointId, AsyncCheckpointR
 		synchronized (lock) {
 			if (closed) {
 				LOG.debug("Cannot register Closeable, this subtaskCheckpointCoordinator is already closed. Closing argument.");
-				final boolean running = asyncCheckpointRunnable.isRunning();
 				closeQuietly(asyncCheckpointRunnable);
 				checkState(
-					!running,
-					"SubtaskCheckpointCoordinatorImpl was closed without closing asyncCheckpointRunnable %s",
+					!checkpoints.containsKey(checkpointId),
+					"SubtaskCheckpointCoordinator was closed without releasing asyncCheckpointRunnable, %s",

Review comment:
       nit: I guess it seem not very readable for message like `.....releasing asyncCheckpointRunnable, 12`. Maybe change to `......releasing asyncCheckpointRunnable for checkpoint 12`? (Take checkpointId = 12 as example).




----------------------------------------------------------------
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 #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016",
       "triggerID" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9578eb8c57698bec3490503073833a93a810847a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6045",
       "triggerID" : "9578eb8c57698bec3490503073833a93a810847a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 358ebf0c0aaffb505bc95a97d6133183ec749d7a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016) 
   * 9578eb8c57698bec3490503073833a93a810847a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6045) 
   
   <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 #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016",
       "triggerID" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9578eb8c57698bec3490503073833a93a810847a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9578eb8c57698bec3490503073833a93a810847a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 358ebf0c0aaffb505bc95a97d6133183ec749d7a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016) 
   * 9578eb8c57698bec3490503073833a93a810847a 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 pull request #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   Thanks for reviewing @zhijiangW, I've updated the PR (the error message).


----------------------------------------------------------------
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 #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 358ebf0c0aaffb505bc95a97d6133183ec749d7a 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 #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6016",
       "triggerID" : "358ebf0c0aaffb505bc95a97d6133183ec749d7a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9578eb8c57698bec3490503073833a93a810847a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6045",
       "triggerID" : "9578eb8c57698bec3490503073833a93a810847a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9578eb8c57698bec3490503073833a93a810847a Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=6045) 
   
   <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 #13286: [FLINK-19093][task] Fix isActive check in AsyncCheckpointRunnable

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -366,11 +366,10 @@ private void registerAsyncCheckpointRunnable(long checkpointId, AsyncCheckpointR
 		synchronized (lock) {
 			if (closed) {
 				LOG.debug("Cannot register Closeable, this subtaskCheckpointCoordinator is already closed. Closing argument.");
-				final boolean running = asyncCheckpointRunnable.isRunning();
 				closeQuietly(asyncCheckpointRunnable);
 				checkState(
-					!running,

Review comment:
       Then let's leave it as-is for now. 




----------------------------------------------------------------
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