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/05/15 20:51:56 UTC

[GitHub] [flink] AHeise opened a new pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

AHeise opened a new pull request #12186:
URL: https://github.com/apache/flink/pull/12186


   
   <!--
   *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 Travis CI to do that following [this guide](https://flink.apache.org/contributing/contribute-code.html#open-a-pull-request).
   
     - 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
   
   Through StreamOperatorWrapper an operator may already be closed while the StreamTask is still running. Notification might be relayed in that time from the task to the closed operator causing issues on operators reacting on completed checkpoints, such as two phase commit sinks.
   
   ## Brief change log
   
   - This commit adds the information of the closing to the wrapper and avoids relaying notifications to closed operators.
   - Also fixes a potential related issue in SubtaskCheckpointCoordinatorImpl#takeSnapshotSync.
   
   ## Verifying this change
   
     - Added StreamTaskTest#testNotifyCheckpointOnClosedOperator
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
   


----------------------------------------------------------------
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] AHeise commented on pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   @flinkbot run azure


----------------------------------------------------------------
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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2 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] pnowojski commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -174,7 +174,9 @@ public void notifyCheckpointComplete(long checkpointId, OperatorChain<?, ?> oper
 			LOG.debug("Notification of complete checkpoint for task {}", taskName);
 
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorWrapper.getStreamOperator().notifyCheckpointComplete(checkpointId);
+				if (!operatorWrapper.isClosed()) {

Review comment:
       If one operator is closed in the chain, doesn't it mean all of them are closed?




----------------------------------------------------------------
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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 25f5493bb635b3876ef629cdfb87b3d7a6aa8fff Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520) 
   * 17deb1ace51d274715027adbeb607feb3958347a 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] pnowojski commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointFailureReason.java
##########
@@ -44,6 +44,8 @@
 
 	CHECKPOINT_DECLINED_TASK_NOT_READY(false, "Checkpoint was declined (tasks not ready)"),
 
+	CHECKPOINT_DECLINED_TASK_CLOSING(false, "Checkpoint was declined (task's operators partially closed)"),

Review comment:
       I think this is missing a relevant entry in `CheckpointFailureManager` switch/case




----------------------------------------------------------------
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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 17deb1ace51d274715027adbeb607feb3958347a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577) 
   * f512eeef60f86107d945f975b1ca8dead57db9c4 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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476) 
   
   <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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 25f5493bb635b3876ef629cdfb87b3d7a6aa8fff Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520) 
   * 17deb1ace51d274715027adbeb607feb3958347a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577) 
   
   <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] AHeise commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OperatorChain.java
##########
@@ -262,7 +262,9 @@ public void prepareSnapshotPreBarrier(long checkpointId) throws Exception {
 		// go forward through the operator chain and tell each operator
 		// to prepare the checkpoint
 		for (StreamOperatorWrapper<?, ?> operatorWrapper : getAllOperators()) {
-			operatorWrapper.getStreamOperator().prepareSnapshotPreBarrier(checkpointId);
+			if (!operatorWrapper.isClosed()) {
+				operatorWrapper.getStreamOperator().prepareSnapshotPreBarrier(checkpointId);
+			}

Review comment:
       I was also think about that. The question is should we then replace it for all `StreamOperatorWrapper.getOperator ` calls eventually?

##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -269,16 +284,18 @@ private void takeSnapshotSync(
 
 		try {
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorSnapshotsInProgress.put(
-					operatorWrapper.getStreamOperator().getOperatorID(),
-					buildOperatorSnapshotFutures(
-						checkpointMetaData,
-						checkpointOptions,
-						operatorChain,
-						operatorWrapper.getStreamOperator(),
-						isCanceled,
-						channelStateWriteResult,
-						storage));
+				if (!operatorWrapper.isClosed()) {

Review comment:
       yep sorry that's a left over from the previous version.




----------------------------------------------------------------
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] pnowojski commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -174,7 +174,9 @@ public void notifyCheckpointComplete(long checkpointId, OperatorChain<?, ?> oper
 			LOG.debug("Notification of complete checkpoint for task {}", taskName);
 
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorWrapper.getStreamOperator().notifyCheckpointComplete(checkpointId);
+				if (!operatorWrapper.isClosed()) {

Review comment:
       I wonder if we shouldn't throw some exception?

##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -279,16 +281,18 @@ private void takeSnapshotSync(
 
 		try {
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorSnapshotsInProgress.put(
-					operatorWrapper.getStreamOperator().getOperatorID(),
-					buildOperatorSnapshotFutures(
-						checkpointMetaData,
-						checkpointOptions,
-						operatorChain,
-						operatorWrapper.getStreamOperator(),
-						isCanceled,
-						channelStateWriteResult,
-						storage));
+				if (!operatorWrapper.isClosed()) {

Review comment:
       ditto about exception or letting checkpoint coordinator know, that this checkpoint was declined. Otherwise, aren't we risking a situation where this checkpoint will complete, despite this operator not participating in it?
   
   Also it might be better to move this if check much higher, somewhere to the top of `checkpointState` method?




----------------------------------------------------------------
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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 17deb1ace51d274715027adbeb607feb3958347a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577) 
   
   <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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639",
       "triggerID" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "26b98ea10d229f1a49fbbc232dc5cdb83572ac3b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "26b98ea10d229f1a49fbbc232dc5cdb83572ac3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f512eeef60f86107d945f975b1ca8dead57db9c4 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639) 
   * 26b98ea10d229f1a49fbbc232dc5cdb83572ac3b 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] pnowojski merged pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   


----------------------------------------------------------------
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] pnowojski commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -279,16 +281,18 @@ private void takeSnapshotSync(
 
 		try {
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorSnapshotsInProgress.put(
-					operatorWrapper.getStreamOperator().getOperatorID(),
-					buildOperatorSnapshotFutures(
-						checkpointMetaData,
-						checkpointOptions,
-						operatorChain,
-						operatorWrapper.getStreamOperator(),
-						isCanceled,
-						channelStateWriteResult,
-						storage));
+				if (!operatorWrapper.isClosed()) {

Review comment:
       But we have to be careful with the implementation here. I think we can not simply throw an exception, as after fixing https://issues.apache.org/jira/browse/FLINK-17350 (my PR pending review), exceptions thrown from here would fail the task immediately. 
   
   On the other hand, letting this task continue running (even if it's closing?), we could repeat some mistakes from FLINK-17350. 
   
   But as there was no exception in any of the operators, I think it might be fine to just cancel this checkpoint, clean it up and decline it (inform `CheckpointCoordinator` that it has failed).
   
   Another complication might be, how is this suppose to work with stop with savepoint? I hope `isClosed()` couldn't happen in that scenario, since failures while stopping with savepoint might be irrecoverable. 




----------------------------------------------------------------
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] AHeise commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/CheckpointFailureReason.java
##########
@@ -44,6 +44,8 @@
 
 	CHECKPOINT_DECLINED_TASK_NOT_READY(false, "Checkpoint was declined (tasks not ready)"),
 
+	CHECKPOINT_DECLINED_TASK_CLOSING(false, "Checkpoint was declined (task's operators partially closed)"),

Review comment:
       Ah jesus, wtf is this monstrosity. But fixed.




----------------------------------------------------------------
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] pnowojski commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -269,16 +284,18 @@ private void takeSnapshotSync(
 
 		try {
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorSnapshotsInProgress.put(
-					operatorWrapper.getStreamOperator().getOperatorID(),
-					buildOperatorSnapshotFutures(
-						checkpointMetaData,
-						checkpointOptions,
-						operatorChain,
-						operatorWrapper.getStreamOperator(),
-						isCanceled,
-						channelStateWriteResult,
-						storage));
+				if (!operatorWrapper.isClosed()) {

Review comment:
       isn't this a duplicated call, now with the same check above?

##########
File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTest.java
##########
@@ -934,6 +936,62 @@ public void testOperatorClosingBeforeStopRunning() throws Throwable {
 		}
 	}
 
+	/**
+	 * Tests that {@link StreamTask#notifyCheckpointCompleteAsync(long)} is not relayed to closed operators.
+	 *
+	 * <p>See FLINK-16383.
+	 */
+	@Test
+	public void testNotifyCheckpointOnClosedOperator() throws Throwable {
+		ClosingOperator operator = new ClosingOperator();
+		MultipleInputStreamTaskTestHarnessBuilder<Integer> builder =
+			new MultipleInputStreamTaskTestHarnessBuilder<>(OneInputStreamTask::new, BasicTypeInfo.INT_TYPE_INFO)
+				.addInput(BasicTypeInfo.INT_TYPE_INFO);
+		StreamTaskMailboxTestHarness<Integer> harness = builder
+			.setupOutputForSingletonOperatorChain(operator)
+			.build();
+		// keeps the mailbox from suspending
+		harness.setAutoProcess(false);
+		harness.processElement(new StreamRecord<>(1));
+
+		harness.streamTask.notifyCheckpointCompleteAsync(1);
+		harness.streamTask.runMailboxStep();
+		assertEquals(1, operator.notified.get());
+		assertEquals(false, operator.closed.get());
+
+		// close operators directly, so that task is still fully running
+		harness.streamTask.operatorChain.closeOperators(harness.streamTask.getActionExecutor());
+		harness.streamTask.notifyCheckpointCompleteAsync(2);
+		harness.streamTask.runMailboxStep();
+		assertEquals(1, operator.notified.get());
+		assertEquals(true, operator.closed.get());
+	}
+
+	/**
+	 * Tests that checkpoints are declined if operators are (partially) closed.
+	 *
+	 * <p>See FLINK-16383.
+	 */
+	@Test
+	public void testCheckpointDeclinedOnClosedOperator() throws Throwable {
+		ClosingOperator operator = new ClosingOperator();
+		MultipleInputStreamTaskTestHarnessBuilder<Integer> builder =
+			new MultipleInputStreamTaskTestHarnessBuilder<>(OneInputStreamTask::new, BasicTypeInfo.INT_TYPE_INFO)

Review comment:
       oO I haven't tested it with `OneInputStreamTask::new` :) Good to know that it's working.

##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OperatorChain.java
##########
@@ -262,7 +262,9 @@ public void prepareSnapshotPreBarrier(long checkpointId) throws Exception {
 		// go forward through the operator chain and tell each operator
 		// to prepare the checkpoint
 		for (StreamOperatorWrapper<?, ?> operatorWrapper : getAllOperators()) {
-			operatorWrapper.getStreamOperator().prepareSnapshotPreBarrier(checkpointId);
+			if (!operatorWrapper.isClosed()) {
+				operatorWrapper.getStreamOperator().prepareSnapshotPreBarrier(checkpointId);
+			}

Review comment:
       Maybe it would be better push the `isClosed()` checks into the wrapper class? And instead of:
   ```
   if (!operatorWrapper.isClosed()) {
   	operatorWrapper.getStreamOperator().prepareSnapshotPreBarrier(checkpointId);
   }
   ```
   have here (and in other places):
   ```
   operatorWrapper.prepareSnapshotPreBarrier(checkpointId);
   ```
   ?




----------------------------------------------------------------
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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476) 
   * 25f5493bb635b3876ef629cdfb87b3d7a6aa8fff Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520) 
   
   <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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639",
       "triggerID" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 17deb1ace51d274715027adbeb607feb3958347a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577) 
   * f512eeef60f86107d945f975b1ca8dead57db9c4 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639) 
   
   <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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639",
       "triggerID" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "26b98ea10d229f1a49fbbc232dc5cdb83572ac3b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1688",
       "triggerID" : "26b98ea10d229f1a49fbbc232dc5cdb83572ac3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f512eeef60f86107d945f975b1ca8dead57db9c4 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639) 
   * 26b98ea10d229f1a49fbbc232dc5cdb83572ac3b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1688) 
   
   <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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476) 
   
   <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] AHeise commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -279,16 +281,18 @@ private void takeSnapshotSync(
 
 		try {
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorSnapshotsInProgress.put(
-					operatorWrapper.getStreamOperator().getOperatorID(),
-					buildOperatorSnapshotFutures(
-						checkpointMetaData,
-						checkpointOptions,
-						operatorChain,
-						operatorWrapper.getStreamOperator(),
-						isCanceled,
-						channelStateWriteResult,
-						storage));
+				if (!operatorWrapper.isClosed()) {

Review comment:
       Here I guess you are right, inconsistent checkpoint does not make any 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] AHeise commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -174,7 +174,9 @@ public void notifyCheckpointComplete(long checkpointId, OperatorChain<?, ?> oper
 			LOG.debug("Notification of complete checkpoint for task {}", taskName);
 
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorWrapper.getStreamOperator().notifyCheckpointComplete(checkpointId);
+				if (!operatorWrapper.isClosed()) {

Review comment:
       Not with the wrapper. It closes them one after another from head to tail with mails. That's why the notify can sneak in in the first place.




----------------------------------------------------------------
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] pnowojski commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/OperatorChain.java
##########
@@ -262,7 +262,9 @@ public void prepareSnapshotPreBarrier(long checkpointId) throws Exception {
 		// go forward through the operator chain and tell each operator
 		// to prepare the checkpoint
 		for (StreamOperatorWrapper<?, ?> operatorWrapper : getAllOperators()) {
-			operatorWrapper.getStreamOperator().prepareSnapshotPreBarrier(checkpointId);
+			if (!operatorWrapper.isClosed()) {
+				operatorWrapper.getStreamOperator().prepareSnapshotPreBarrier(checkpointId);
+			}

Review comment:
       Maybe in the future?




----------------------------------------------------------------
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] AHeise commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -174,7 +174,9 @@ public void notifyCheckpointComplete(long checkpointId, OperatorChain<?, ?> oper
 			LOG.debug("Notification of complete checkpoint for task {}", taskName);
 
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorWrapper.getStreamOperator().notifyCheckpointComplete(checkpointId);
+				if (!operatorWrapper.isClosed()) {

Review comment:
       Not with the wrapper. It closes them one after another from head to tail with mails. That's why the notify can sneak in in the first place.
   Only when one operator is closed completed, the next operator in line is closed.




----------------------------------------------------------------
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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476) 
   * 25f5493bb635b3876ef629cdfb87b3d7a6aa8fff 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 commented on pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   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 a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2 (Fri May 15 20:53:54 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-16383).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <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] AHeise commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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



##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/SubtaskCheckpointCoordinatorImpl.java
##########
@@ -174,7 +174,9 @@ public void notifyCheckpointComplete(long checkpointId, OperatorChain<?, ?> oper
 			LOG.debug("Notification of complete checkpoint for task {}", taskName);
 
 			for (StreamOperatorWrapper<?, ?> operatorWrapper : operatorChain.getAllOperators(true)) {
-				operatorWrapper.getStreamOperator().notifyCheckpointComplete(checkpointId);
+				if (!operatorWrapper.isClosed()) {

Review comment:
       It depends on what we are trying to achieve. Assume that we have a chain source -> map -> sink and source and map have been closed already. Wouldn't it be nice to still commit stuff in sink?




----------------------------------------------------------------
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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 25f5493bb635b3876ef629cdfb87b3d7a6aa8fff Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520) 
   
   <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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639",
       "triggerID" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f512eeef60f86107d945f975b1ca8dead57db9c4 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639) 
   
   <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 #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   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 26b98ea10d229f1a49fbbc232dc5cdb83572ac3b (Fri Oct 16 10:50:44 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] flinkbot edited a comment on pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1476",
       "triggerID" : "a3129c8853f1b9af6ceb3a1f8749a70a7dc2f9f2",
       "triggerType" : "PUSH"
     }, {
       "hash" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1520",
       "triggerID" : "25f5493bb635b3876ef629cdfb87b3d7a6aa8fff",
       "triggerType" : "PUSH"
     }, {
       "hash" : "17deb1ace51d274715027adbeb607feb3958347a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1577",
       "triggerID" : "17deb1ace51d274715027adbeb607feb3958347a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1639",
       "triggerID" : "f512eeef60f86107d945f975b1ca8dead57db9c4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "26b98ea10d229f1a49fbbc232dc5cdb83572ac3b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1688",
       "triggerID" : "26b98ea10d229f1a49fbbc232dc5cdb83572ac3b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 26b98ea10d229f1a49fbbc232dc5cdb83572ac3b Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1688) 
   
   <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