Skip to content
Snippets Groups Projects
Commit 23431364 authored by Danny Auble's avatar Danny Auble
Browse files

fix to make sure reconnect is off in mysql

parent bf28ff20
No related branches found
No related tags found
No related merge requests found
...@@ -120,6 +120,7 @@ extern int mysql_get_db_connection(MYSQL **mysql_db, char *db_name, ...@@ -120,6 +120,7 @@ extern int mysql_get_db_connection(MYSQL **mysql_db, char *db_name,
{ {
int rc = SLURM_SUCCESS; int rc = SLURM_SUCCESS;
bool storage_init = false; bool storage_init = false;
my_bool reconnect = 0;
if(!(*mysql_db = mysql_init(*mysql_db))) if(!(*mysql_db = mysql_init(*mysql_db)))
fatal("mysql_init failed: %s", mysql_error(*mysql_db)); fatal("mysql_init failed: %s", mysql_error(*mysql_db));
...@@ -144,6 +145,8 @@ extern int mysql_get_db_connection(MYSQL **mysql_db, char *db_name, ...@@ -144,6 +145,8 @@ extern int mysql_get_db_connection(MYSQL **mysql_db, char *db_name,
storage_init = true; storage_init = true;
} }
} }
/* make sure reconnect is off */
mysql_options(*mysql_db, MYSQL_OPT_RECONNECT, &reconnect);
} }
return rc; return rc;
} }
......
...@@ -322,7 +322,7 @@ extern int jobacct_storage_p_job_start(struct job_record *job_ptr) ...@@ -322,7 +322,7 @@ extern int jobacct_storage_p_job_start(struct job_record *job_ptr)
char query[1024]; char query[1024];
int reinit = 0; int reinit = 0;
if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db)) { if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db) != 0) {
char *loc = slurm_get_jobacct_storage_loc(); char *loc = slurm_get_jobacct_storage_loc();
if(jobacct_storage_p_init(loc) == SLURM_ERROR) { if(jobacct_storage_p_init(loc) == SLURM_ERROR) {
xfree(loc); xfree(loc);
...@@ -417,7 +417,7 @@ extern int jobacct_storage_p_job_complete(struct job_record *job_ptr) ...@@ -417,7 +417,7 @@ extern int jobacct_storage_p_job_complete(struct job_record *job_ptr)
char *account, *nodes; char *account, *nodes;
int rc=SLURM_SUCCESS; int rc=SLURM_SUCCESS;
if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db)) { if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db) != 0) {
char *loc = slurm_get_jobacct_storage_loc(); char *loc = slurm_get_jobacct_storage_loc();
if(jobacct_storage_p_init(loc) == SLURM_ERROR) { if(jobacct_storage_p_init(loc) == SLURM_ERROR) {
xfree(loc); xfree(loc);
...@@ -475,7 +475,7 @@ extern int jobacct_storage_p_step_start(struct step_record *step_ptr) ...@@ -475,7 +475,7 @@ extern int jobacct_storage_p_step_start(struct step_record *step_ptr)
#endif #endif
char query[1024]; char query[1024];
if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db)) { if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db) != 0) {
char *loc = slurm_get_jobacct_storage_loc(); char *loc = slurm_get_jobacct_storage_loc();
if(jobacct_storage_p_init(loc) == SLURM_ERROR) { if(jobacct_storage_p_init(loc) == SLURM_ERROR) {
xfree(loc); xfree(loc);
...@@ -554,7 +554,7 @@ extern int jobacct_storage_p_step_complete(struct step_record *step_ptr) ...@@ -554,7 +554,7 @@ extern int jobacct_storage_p_step_complete(struct step_record *step_ptr)
char query[1024]; char query[1024];
int rc =SLURM_SUCCESS; int rc =SLURM_SUCCESS;
if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db)) { if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db) != 0) {
char *loc = slurm_get_jobacct_storage_loc(); char *loc = slurm_get_jobacct_storage_loc();
if(jobacct_storage_p_init(loc) == SLURM_ERROR) { if(jobacct_storage_p_init(loc) == SLURM_ERROR) {
xfree(loc); xfree(loc);
...@@ -719,7 +719,7 @@ extern int jobacct_storage_p_suspend(struct job_record *job_ptr) ...@@ -719,7 +719,7 @@ extern int jobacct_storage_p_suspend(struct job_record *job_ptr)
char query[1024]; char query[1024];
int rc = SLURM_SUCCESS; int rc = SLURM_SUCCESS;
if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db)) { if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db) != 0) {
char *loc = slurm_get_jobacct_storage_loc(); char *loc = slurm_get_jobacct_storage_loc();
if(jobacct_storage_p_init(loc) == SLURM_ERROR) { if(jobacct_storage_p_init(loc) == SLURM_ERROR) {
xfree(loc); xfree(loc);
...@@ -764,7 +764,7 @@ extern void jobacct_storage_p_get_jobs(List job_list, ...@@ -764,7 +764,7 @@ extern void jobacct_storage_p_get_jobs(List job_list,
void *params) void *params)
{ {
#ifdef HAVE_MYSQL #ifdef HAVE_MYSQL
if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db)) { if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db) != 0) {
char *loc = slurm_get_jobacct_storage_loc(); char *loc = slurm_get_jobacct_storage_loc();
if(jobacct_storage_p_init(loc) == SLURM_ERROR) { if(jobacct_storage_p_init(loc) == SLURM_ERROR) {
xfree(loc); xfree(loc);
...@@ -786,7 +786,7 @@ extern void jobacct_storage_p_archive(List selected_parts, ...@@ -786,7 +786,7 @@ extern void jobacct_storage_p_archive(List selected_parts,
void *params) void *params)
{ {
#ifdef HAVE_MYSQL #ifdef HAVE_MYSQL
if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db)) { if(!jobacct_mysql_db || mysql_ping(jobacct_mysql_db) != 0) {
char *loc = slurm_get_jobacct_storage_loc(); char *loc = slurm_get_jobacct_storage_loc();
if(jobacct_storage_p_init(loc) == SLURM_ERROR) { if(jobacct_storage_p_init(loc) == SLURM_ERROR) {
xfree(loc); xfree(loc);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment