From c46351c9c12fd676dec26549939a310d2a698e9f Mon Sep 17 00:00:00 2001
From: Danny Auble <da@llnl.gov>
Date: Fri, 25 Mar 2011 23:32:01 +0000
Subject: [PATCH] better error handling, we need to make sure we add blocks to
 the list before starting the real time server or we could miss things on
 start up

---
 src/plugins/select/bluegene/bl_bgq/bridge_helper.cc | 7 +++++++
 src/plugins/select/bluegene/bl_bgq/bridge_status.cc | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/plugins/select/bluegene/bl_bgq/bridge_helper.cc b/src/plugins/select/bluegene/bl_bgq/bridge_helper.cc
index 2be3dda000b..4a4196c33f2 100644
--- a/src/plugins/select/bluegene/bl_bgq/bridge_helper.cc
+++ b/src/plugins/select/bluegene/bl_bgq/bridge_helper.cc
@@ -180,6 +180,13 @@ extern int bridge_handle_input_errors(const char *function, const uint32_t err,
 		      function, err);
 		rc = SLURM_ERROR;
 	}
+	if (bg_record && (rc == SLURM_SUCCESS)) {
+		/* Make sure we set this to free since if it isn't in
+		   the system and we are waiting for it to be free, we
+		   will be waiting around for a long time ;).
+		*/
+		bg_record->state = BG_BLOCK_FREE;
+	}
 	return rc;
 }
 
diff --git a/src/plugins/select/bluegene/bl_bgq/bridge_status.cc b/src/plugins/select/bluegene/bl_bgq/bridge_status.cc
index 4401534d0ed..b221b035214 100644
--- a/src/plugins/select/bluegene/bl_bgq/bridge_status.cc
+++ b/src/plugins/select/bluegene/bl_bgq/bridge_status.cc
@@ -200,7 +200,8 @@ void event_handler::handleBlockStateChangedRealtimeEvent(
 	bg_record = find_bg_record_in_list(bg_lists->main, bg_block_id);
 	if (!bg_record) {
 		slurm_mutex_unlock(&block_state_mutex);
-		info("bg_record %s isn't in the main list", bg_block_id);
+		info("bridge_status: bg_record %s isn't in the main list",
+		     bg_block_id);
 		return;
 	}
 
-- 
GitLab