diff --git a/core/trino-main/src/main/java/io/trino/execution/executor/timesharing/TimeSharingTaskExecutor.java b/core/trino-main/src/main/java/io/trino/execution/executor/timesharing/TimeSharingTaskExecutor.java index 7d7d31a50b4a..c57423caa4c7 100644 --- a/core/trino-main/src/main/java/io/trino/execution/executor/timesharing/TimeSharingTaskExecutor.java +++ b/core/trino-main/src/main/java/io/trino/execution/executor/timesharing/TimeSharingTaskExecutor.java @@ -325,9 +325,9 @@ private boolean doRemoveTask(TimeSharingTaskHandle taskHandle) splits = taskHandle.destroy(); // stop tracking splits (especially blocked splits which may never unblock) - allSplits.removeAll(splits); - intermediateSplits.removeAll(splits); - blockedSplits.keySet().removeAll(splits); + splits.forEach(allSplits::remove); + splits.forEach(intermediateSplits::remove); + splits.forEach(blockedSplits.keySet()::remove); waitingSplits.removeAll(splits); recordLeafSplitsSize(); } diff --git a/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java b/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java index b5f1e3b9876c..6308cc9a2d98 100644 --- a/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java +++ b/core/trino-main/src/main/java/io/trino/failuredetector/HeartbeatFailureDetector.java @@ -234,7 +234,7 @@ void updateMonitoredServices() .map(ServiceDescriptor::getId) .collect(toImmutableList()); - tasks.keySet().removeAll(expiredIds); + expiredIds.forEach(tasks.keySet()::remove); // 2. disable offline services tasks.values().stream()