zentol commented on a change in pull request #18552:
URL: https://github.com/apache/flink/pull/18552#discussion_r794386968



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java
##########
@@ -521,8 +522,18 @@ public void acknowledgeCheckpoint(
             final ExecutionAttemptID executionAttemptID,
             final long checkpointId,
             final CheckpointMetrics checkpointMetrics,
-            final TaskStateSnapshot checkpointState) {
+            @Nullable final SerializedValue<TaskStateSnapshot> 
serializedCheckpointState) {
 
+        TaskStateSnapshot checkpointState;
+        try {
+            checkpointState =
+                    serializedCheckpointState == null
+                            ? null
+                            : serializedCheckpointState.deserializeValue(
+                                    ClassLoader.getSystemClassLoader());

Review comment:
       ```suggestion
                                       getClass().getClassLoader());
   ```
   It may be problematic for certain use-cases to assume that Flink is loaded 
by the system classloader.

##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/utils/TestingJobMasterGateway.java
##########
@@ -436,10 +438,18 @@ public void acknowledgeCheckpoint(
             ExecutionAttemptID executionAttemptID,
             long checkpointId,
             CheckpointMetrics checkpointMetrics,
-            TaskStateSnapshot subtaskState) {
+            SerializedValue<TaskStateSnapshot> subtaskState) {
+        TaskStateSnapshot snapshot;
+        try {
+            snapshot =
+                    subtaskState == null
+                            ? null
+                            : 
subtaskState.deserializeValue(ClassLoader.getSystemClassLoader());

Review comment:
       We could add some utility methods to the TaskStateSnapshot for the 
serialization so this becomes less  noisy.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to