diff --git a/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java b/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java index fb137d24db..ff88010a76 100644 --- a/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java +++ b/SingularityService/src/main/java/com/hubspot/singularity/data/TaskManager.java @@ -999,18 +999,14 @@ private List getTaskIdsForRequest( String requestId, TaskFilter taskFilter ) { + final List activeTaskIds = getChildrenAsIds( + getLastActiveTaskParent(requestId), + taskIdTranscoder + ); if (taskFilter == TaskFilter.ACTIVE) { - if (leaderCache.active()) { - return leaderCache.getActiveTaskIdsForRequest(requestId); - } else { - return getActiveTaskIds() - .stream() - .filter(t -> t.getRequestId().equals(requestId)) - .collect(Collectors.toList()); - } + return activeTaskIds; } final List requestTaskIds = getTaskIdsForRequest(requestId); - final List activeTaskIds = filterActiveTaskIds(requestTaskIds); Iterables.removeAll(requestTaskIds, activeTaskIds); return requestTaskIds;