From 534dfb67fb76e941a2990b382ef2249b79458a6b Mon Sep 17 00:00:00 2001
From: Brian Christiansen <brian@schedmd.com>
Date: Fri, 2 Jan 2015 12:21:09 -0800
Subject: [PATCH] Revert "Make srun reload configuration if conf is different
 after receiving allocation."

This reverts commit abc435fd92b03f73dc7e2d0d67f48fec4736d81b.
---
 NEWS                        |  1 -
 src/common/read_config.c    | 24 +-----------------------
 src/srun/libsrun/allocate.c |  5 -----
 3 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/NEWS b/NEWS
index 796bb7a8cfc..c3f98fa1dc8 100644
--- a/NEWS
+++ b/NEWS
@@ -11,7 +11,6 @@ documents those changes that are of interest to users and administrators.
  -- Enable per-partition gang scheduling resource resolution (e.g. the partition
     can have SelectTypeParameters=CR_CORE, while the global value is CR_SOCKET).
  -- Make it so a newer version of a slurmstepd can talk to an older srun.
- -- Make srun reload configuration if conf is different after receiving
     allocation. Nodes could have been added while waiting for an allocation.
  -- Expanded --cpu-freq parameters to include min-max:governor specifications.
     --cpu-freq now supported on salloc and sbatch.
diff --git a/src/common/read_config.c b/src/common/read_config.c
index 59d2c329ed8..1e0498ce726 100644
--- a/src/common/read_config.c
+++ b/src/common/read_config.c
@@ -107,7 +107,6 @@ static pthread_mutex_t conf_lock = PTHREAD_MUTEX_INITIALIZER;
 static s_p_hashtbl_t *conf_hashtbl = NULL;
 static slurm_ctl_conf_t *conf_ptr = &slurmctld_conf;
 static bool conf_initialized = false;
-static time_t conf_mod_time = (time_t) 0;
 
 static s_p_hashtbl_t *default_frontend_tbl;
 static s_p_hashtbl_t *default_nodename_tbl;
@@ -358,22 +357,6 @@ s_p_options_t slurm_conf_options[] = {
 	{NULL}
 };
 
-static time_t _get_conf_mod_time(const char *file_name)
-{
-	struct stat config_stat;
-	char *name = (char *)file_name;
-
-	if (name == NULL) {
-		name = getenv("SLURM_CONF");
-		if (name == NULL)
-			name = default_slurm_config_file;
-	}
-
-	if (stat(name, &config_stat) == -1)
-		fatal("Can't stat config file %s: %m", name);
-	return config_stat.st_mtime;
-}
-
 static bool _is_valid_path (char *path, char *msg)
 {
 	/*
@@ -2650,7 +2633,6 @@ static int _init_slurm_conf(const char *file_name)
 	if (_validate_and_set_defaults(conf_ptr, conf_hashtbl) == SLURM_ERROR)
 		return SLURM_ERROR;
 
-	conf_mod_time        = _get_conf_mod_time(name);
 	conf_ptr->slurm_conf = xstrdup(name);
 	return SLURM_SUCCESS;
 }
@@ -2720,12 +2702,8 @@ static int _internal_reinit(const char *file_name)
 			name = default_slurm_config_file;
 	}
 
-	if (_get_conf_mod_time(file_name) == conf_mod_time) {
-		debug4("no change in config file, not reconfiguring.");
-		return rc;
-	}
-
 	if (conf_initialized) {
+		/* could check modified time on slurm.conf here */
 		_destroy_slurm_conf();
 	}
 
diff --git a/src/srun/libsrun/allocate.c b/src/srun/libsrun/allocate.c
index a093e22f945..91bbdc62935 100644
--- a/src/srun/libsrun/allocate.c
+++ b/src/srun/libsrun/allocate.c
@@ -480,11 +480,6 @@ allocate_nodes(bool handle_signals)
 	}
 
 	if (resp && !destroy_job) {
-
-		/* New nodes may have been added while waiting for an
-		 * allocation. Will reinit only if file has changed. */
-		slurm_conf_reinit(NULL);
-
 		/*
 		 * Allocation granted!
 		 */
-- 
GitLab