You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by xt...@apache.org on 2025/07/17 03:44:41 UTC
(flink) branch master updated: [FLINK-38098][Runtime] Fix JobClientHeartbeatRequestBody deserialization error
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push:
new d4b2a721f06 [FLINK-38098][Runtime] Fix JobClientHeartbeatRequestBody deserialization error
d4b2a721f06 is described below
commit d4b2a721f06b8d1fef2c35ed3c20f5da8cffc240
Author: shilei <he...@qq.com>
AuthorDate: Wed Jul 16 09:54:34 2025 +0800
[FLINK-38098][Runtime] Fix JobClientHeartbeatRequestBody deserialization error
---
.../messages/JobClientHeartbeatRequestBody.java | 2 +-
.../JobClientHeartbeatRequestBodyTest.java | 45 ++++++++++++++++++++++
2 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java
index d38cd5405c7..9e4d829a7ca 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBody.java
@@ -30,7 +30,7 @@ public class JobClientHeartbeatRequestBody implements RequestBody {
private final long expiredTimestamp;
@JsonCreator
- public JobClientHeartbeatRequestBody(long expiredTimestamp) {
+ public JobClientHeartbeatRequestBody(@JsonProperty(EXPIRED_TIMESTAMP) long expiredTimestamp) {
this.expiredTimestamp = expiredTimestamp;
}
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBodyTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBodyTest.java
new file mode 100644
index 00000000000..95f496cffb9
--- /dev/null
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/rest/messages/JobClientHeartbeatRequestBodyTest.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.rest.messages;
+
+import org.apache.flink.testutils.junit.extensions.parameterized.NoOpTestExtension;
+
+import org.junit.jupiter.api.extension.ExtendWith;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+@ExtendWith(NoOpTestExtension.class)
+public class JobClientHeartbeatRequestBodyTest
+ extends RestRequestMarshallingTestBase<JobClientHeartbeatRequestBody> {
+ @Override
+ protected Class<JobClientHeartbeatRequestBody> getTestRequestClass() {
+ return JobClientHeartbeatRequestBody.class;
+ }
+
+ @Override
+ protected JobClientHeartbeatRequestBody getTestRequestInstance() throws Exception {
+ return new JobClientHeartbeatRequestBody(System.currentTimeMillis());
+ }
+
+ @Override
+ protected void assertOriginalEqualsToUnmarshalled(
+ JobClientHeartbeatRequestBody expected, JobClientHeartbeatRequestBody actual) {
+ assertThat(expected.getExpiredTimestamp()).isEqualTo(actual.getExpiredTimestamp());
+ }
+}