[hotfix] Introduce null checks for SlotManager#suspend
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/15847c4d Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/15847c4d Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/15847c4d Branch: refs/heads/release-1.5 Commit: 15847c4d9c3155aa9a46498d5cf3a6676e0fa08d Parents: 29b34e2 Author: Till Rohrmann <trohrm...@apache.org> Authored: Thu Mar 1 17:02:29 2018 +0100 Committer: Till Rohrmann <trohrm...@apache.org> Committed: Fri Mar 2 08:53:49 2018 +0100 ---------------------------------------------------------------------- .../resourcemanager/slotmanager/SlotManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/15847c4d/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java ---------------------------------------------------------------------- diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java b/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java index f078a28..ca33719 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java @@ -208,11 +208,15 @@ public class SlotManager implements AutoCloseable { LOG.info("Suspending the SlotManager."); // stop the timeout checks for the TaskManagers and the SlotRequests - taskManagerTimeoutCheck.cancel(false); - slotRequestTimeoutCheck.cancel(false); + if (taskManagerTimeoutCheck != null) { + taskManagerTimeoutCheck.cancel(false); + taskManagerTimeoutCheck = null; + } - taskManagerTimeoutCheck = null; - slotRequestTimeoutCheck = null; + if (slotRequestTimeoutCheck != null) { + slotRequestTimeoutCheck.cancel(false); + slotRequestTimeoutCheck = null; + } for (PendingSlotRequest pendingSlotRequest : pendingSlotRequests.values()) { cancelPendingSlotRequest(pendingSlotRequest);