Fix bug in KillStalePendingSegments (#14961)

This commit is contained in:
Kashif Faraz 2023-09-11 15:18:15 +05:30 committed by GitHub
parent dec6a0aa14
commit 7871e633c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -118,9 +118,7 @@ public class KillStalePendingSegments implements CoordinatorDuty
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()