From bf2ac92ba289f2391fa9ca3359d88a57c2cfc838 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Mon, 17 Dec 2012 13:59:59 -0800
Subject: [PATCH] Another fix for for handling power state resume on restart of
 slurmctld.

---
 src/slurmctld/ping_nodes.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/slurmctld/ping_nodes.c b/src/slurmctld/ping_nodes.c
index 184596ee33e..dd361d61196 100644
--- a/src/slurmctld/ping_nodes.c
+++ b/src/slurmctld/ping_nodes.c
@@ -262,7 +262,12 @@ void ping_nodes (void)
 			continue;
 		}
 
-		if (restart_flag)
+		/* If we are resuming nodes from power save we need to
+		   keep the larger last_response so we don't
+		   accidentally mark them as "unexpectedly rebooted".
+		*/
+		if (restart_flag
+		    && (node_ptr->last_response < slurmctld_conf.last_update))
 			node_ptr->last_response = slurmctld_conf.last_update;
 
 		/* Request a node registration if its state is UNKNOWN or
-- 
GitLab