Skip to content
Snippets Groups Projects
Commit a6f4a2ce authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files

Eliminate confusing "Attach to job failed\!" message

parent 9876c6f8
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,6 @@ typedef struct thd { ...@@ -69,7 +69,6 @@ typedef struct thd {
srun_job_t *job; srun_job_t *job;
} thd_t; } thd_t;
static inline bool _job_all_done(srun_job_t *job);
static void _p_reattach(slurm_msg_t *req, srun_job_t *job); static void _p_reattach(slurm_msg_t *req, srun_job_t *job);
static void *_p_reattach_task(void *args); static void *_p_reattach_task(void *args);
...@@ -472,14 +471,22 @@ int reattach() ...@@ -472,14 +471,22 @@ int reattach()
_attach_to_job(job); _attach_to_job(job);
slurm_mutex_lock(&job->state_mutex); slurm_mutex_lock(&job->state_mutex);
while (!_job_all_done(job)) while (job->state < SRUN_JOB_TERMINATED) {
pthread_cond_wait(&job->state_cond, &job->state_mutex); pthread_cond_wait(&job->state_cond, &job->state_mutex);
}
slurm_mutex_unlock(&job->state_mutex); slurm_mutex_unlock(&job->state_mutex);
if (job->state == SRUN_JOB_FAILED) if (job->state == SRUN_JOB_FAILED)
error ("Attach to job failed!"); info("Job terminated abnormally.");
/* wait for stdio */ /*
* Signal the IO thread to shutdown, which will stop
* the listening socket and file read (stdin) event
* IO objects, but allow file write (stdout) objects to
* complete any writing that remains.
*/
debug("Waiting for IO thread");
eio_signal_shutdown(job->eio);
if (pthread_join(job->ioid, NULL) < 0) if (pthread_join(job->ioid, NULL) < 0)
error ("Waiting on IO: %m"); error ("Waiting on IO: %m");
...@@ -490,10 +497,3 @@ int reattach() ...@@ -490,10 +497,3 @@ int reattach()
exit(0); exit(0);
} }
static bool _job_all_done(srun_job_t *job)
{
return (job->state >= SRUN_JOB_TERMINATED);
}
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