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/16 04:39:09 UTC

[GitHub] [flink] pnowojski commented on a change in pull request #12186: [FLINK-16383][task] Do not relay notifyCheckpointComplete to closed operators

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