This is an automated email from the ASF dual-hosted git repository. panyuepeng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
commit dafa51f6aab269b03e79b52c131ba144647f9602 Author: Yuepeng Pan <[email protected]> AuthorDate: Thu Apr 9 19:13:31 2026 +0800 [hotfix][runtime] Fix the SchedulerStateSpan#stringifiedException render logic to avoid adding null exception string and polish the attributes naming in the rescale history related classes. Co-authored-by: och5351 <[email protected]> --- .../rest/messages/job/rescales/JobRescaleDetails.java | 12 ++++++------ .../runtime/scheduler/adaptive/timeline/Rescale.java | 6 ++++-- .../adaptive/timeline/SlotSharingGroupRescale.java | 16 ++++++++-------- .../runtime/scheduler/adaptive/timeline/RescaleTest.java | 2 +- .../adaptive/timeline/RescaleTimelineITCase.java | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/rescales/JobRescaleDetails.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/rescales/JobRescaleDetails.java index fa9b7aeb195..82cdd35fac3 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/rescales/JobRescaleDetails.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/rescales/JobRescaleDetails.java @@ -416,7 +416,7 @@ public class JobRescaleDetails implements ResponseBody, Serializable { private final String slotSharingGroupName; @JsonProperty(FIELD_NAME_REQUEST_RESOURCE_PROFILE) - private final ResourceProfileInfo requiredResourceProfileInfo; + private final ResourceProfileInfo requestResourceProfileInfo; @JsonProperty(FIELD_NAME_DESIRED_SLOTS) private final Integer desiredSlots; @@ -441,7 +441,7 @@ public class JobRescaleDetails implements ResponseBody, Serializable { SlotSharingGroupId slotSharingGroupId, @JsonProperty(FIELD_NAME_SLOT_SHARING_GROUP_NAME) String slotSharingGroupName, @JsonProperty(FIELD_NAME_REQUEST_RESOURCE_PROFILE) - ResourceProfileInfo requiredResourceProfileInfo, + ResourceProfileInfo requestResourceProfileInfo, @JsonProperty(FIELD_NAME_DESIRED_SLOTS) Integer desiredSlots, @JsonProperty(FIELD_NAME_MINIMAL_REQUIRED_SLOTS) Integer minimalRequiredSlots, @JsonProperty(FIELD_NAME_PRE_RESCALE_SLOTS) Integer preRescaleSlots, @@ -450,7 +450,7 @@ public class JobRescaleDetails implements ResponseBody, Serializable { ResourceProfileInfo acquiredResourceProfileInfo) { this.slotSharingGroupId = slotSharingGroupId; this.slotSharingGroupName = slotSharingGroupName; - this.requiredResourceProfileInfo = requiredResourceProfileInfo; + this.requestResourceProfileInfo = requestResourceProfileInfo; this.desiredSlots = desiredSlots; this.minimalRequiredSlots = minimalRequiredSlots; this.preRescaleSlots = preRescaleSlots; @@ -466,7 +466,7 @@ public class JobRescaleDetails implements ResponseBody, Serializable { SlotSharingGroupRescaleInfo that = (SlotSharingGroupRescaleInfo) o; return Objects.equals(slotSharingGroupId, that.slotSharingGroupId) && Objects.equals(slotSharingGroupName, that.slotSharingGroupName) - && Objects.equals(requiredResourceProfileInfo, that.requiredResourceProfileInfo) + && Objects.equals(requestResourceProfileInfo, that.requestResourceProfileInfo) && Objects.equals(desiredSlots, that.desiredSlots) && Objects.equals(minimalRequiredSlots, that.minimalRequiredSlots) && Objects.equals(preRescaleSlots, that.preRescaleSlots) @@ -480,7 +480,7 @@ public class JobRescaleDetails implements ResponseBody, Serializable { return Objects.hash( slotSharingGroupId, slotSharingGroupName, - requiredResourceProfileInfo, + requestResourceProfileInfo, desiredSlots, minimalRequiredSlots, preRescaleSlots, @@ -494,7 +494,7 @@ public class JobRescaleDetails implements ResponseBody, Serializable { slotSharingGroupRescale.getSlotSharingGroupId(), slotSharingGroupRescale.getSlotSharingGroupName(), ResourceProfileInfo.fromResourceProfile( - slotSharingGroupRescale.getRequiredResourceProfile()), + slotSharingGroupRescale.getRequestResourceProfile()), slotSharingGroupRescale.getDesiredSlots(), slotSharingGroupRescale.getMinimalRequiredSlots(), slotSharingGroupRescale.getPreRescaleSlots(), diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/Rescale.java b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/Rescale.java index 2d9b6381a9a..fa8c0c05afd 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/Rescale.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/Rescale.java @@ -85,7 +85,7 @@ import java.util.stream.Collectors; * + +--> slot sharing group id-1 -> slot-1 sharing group rescale: * + + +--> slot sharing group id * + + +--> slot sharing group name - * + + +--> required resource profile + * + + +--> request resource profile * + + +--> minimal required slots * + + +--> pre-rescale slots * + + +--> post-rescale slots @@ -180,7 +180,9 @@ public class Rescale implements Serializable { enterTimestamp, logicLeaveTimestamp, logicLeaveTimestamp - enterTimestamp, - ExceptionUtils.stringifyException(throwable))); + Objects.isNull(throwable) + ? null + : ExceptionUtils.stringifyException(throwable))); } public List<SchedulerStateSpan> getSchedulerStates() { diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/SlotSharingGroupRescale.java b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/SlotSharingGroupRescale.java index 84ee73275c0..7af862ac9c8 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/SlotSharingGroupRescale.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/SlotSharingGroupRescale.java @@ -37,7 +37,7 @@ public class SlotSharingGroupRescale implements Serializable { private final SlotSharingGroupId slotSharingGroupId; private final String slotSharingGroupName; - private final ResourceProfile requiredResourceProfile; + private final ResourceProfile requestResourceProfile; private Integer desiredSlots; private Integer minimalRequiredSlots; @Nullable private Integer preRescaleSlots; @@ -47,7 +47,7 @@ public class SlotSharingGroupRescale implements Serializable { public SlotSharingGroupRescale(SlotSharingGroup slotSharingGroup) { this.slotSharingGroupId = slotSharingGroup.getSlotSharingGroupId(); this.slotSharingGroupName = slotSharingGroup.getSlotSharingGroupName(); - this.requiredResourceProfile = slotSharingGroup.getResourceProfile(); + this.requestResourceProfile = slotSharingGroup.getResourceProfile(); } public SlotSharingGroupId getSlotSharingGroupId() { @@ -92,8 +92,8 @@ public class SlotSharingGroupRescale implements Serializable { this.postRescaleSlots = postRescaleSlots; } - public ResourceProfile getRequiredResourceProfile() { - return requiredResourceProfile; + public ResourceProfile getRequestResourceProfile() { + return requestResourceProfile; } @Nullable @@ -113,7 +113,7 @@ public class SlotSharingGroupRescale implements Serializable { SlotSharingGroupRescale that = (SlotSharingGroupRescale) o; return Objects.equals(slotSharingGroupId, that.slotSharingGroupId) && Objects.equals(slotSharingGroupName, that.slotSharingGroupName) - && Objects.equals(requiredResourceProfile, that.requiredResourceProfile) + && Objects.equals(requestResourceProfile, that.requestResourceProfile) && Objects.equals(desiredSlots, that.desiredSlots) && Objects.equals(minimalRequiredSlots, that.minimalRequiredSlots) && Objects.equals(preRescaleSlots, that.preRescaleSlots) @@ -126,7 +126,7 @@ public class SlotSharingGroupRescale implements Serializable { return Objects.hash( slotSharingGroupId, slotSharingGroupName, - requiredResourceProfile, + requestResourceProfile, desiredSlots, minimalRequiredSlots, preRescaleSlots, @@ -142,8 +142,8 @@ public class SlotSharingGroupRescale implements Serializable { + ", slotSharingGroupName='" + slotSharingGroupName + '\'' - + ", requiredResourceProfile=" - + requiredResourceProfile + + ", requestResourceProfile=" + + requestResourceProfile + ", desiredSlots=" + desiredSlots + ", minimalRequiredSlots=" diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTest.java index 4664811cb57..3381bfe4dc1 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTest.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTest.java @@ -219,7 +219,7 @@ class RescaleTest { .containsExactlyInAnyOrder(3, 5); assertThat( slots.values().stream() - .map(SlotSharingGroupRescale::getRequiredResourceProfile) + .map(SlotSharingGroupRescale::getRequestResourceProfile) .collect(Collectors.toSet())) .containsExactly(ResourceProfile.UNKNOWN); } diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java index fc105d800dc..fd12bc5de7f 100644 --- a/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java +++ b/flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/timeline/RescaleTimelineITCase.java @@ -631,7 +631,7 @@ class RescaleTimelineITCase { assertThat(slotSharingGroupRescale.getSlotSharingGroupName()).isNotNull(); assertThat(slotSharingGroupRescale.getMinimalRequiredSlots()).isNotNull(); assertThat(slotSharingGroupRescale.getAcquiredResourceProfile()).isNotNull(); - assertThat(slotSharingGroupRescale.getRequiredResourceProfile()).isNotNull(); + assertThat(slotSharingGroupRescale.getRequestResourceProfile()).isNotNull(); assertThat(slotSharingGroupRescale.getSlotSharingGroupId()).isNotNull(); }
