diff --git a/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java b/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java index da730e20c0ba..ad07c3b31772 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/duty/KillStalePendingSegments.java @@ -118,9 +118,7 @@ private DateTime getMinCreatedTimeToRetain() DateTime earliestActiveTaskStart = DateTimes.nowUtc(); DateTime latestCompletedTaskStart = null; for (TaskStatusPlus status : statuses) { - if (status.getStatusCode() == null) { - // Unknown status - } else if (status.getStatusCode().isComplete()) { + if (status.getStatusCode() != null && status.getStatusCode().isComplete()) { latestCompletedTaskStart = DateTimes.laterOf( latestCompletedTaskStart, status.getCreatedTime()