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 2022/01/28 10:53:47 UTC

[GitHub] [flink] zentol commented on a change in pull request #18552: [FLINK-25479][rpc] Serialize TaskStateSnapshot when sending to JM from TM

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: issues-unsubscribe@flink.apache.org

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