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

Quiet errors that aren't really errors

parent 5ce1f5d3
No related branches found
No related tags found
No related merge requests found
...@@ -181,6 +181,7 @@ stepd_signal_container(step_loc_t step, void *auth_cred, int signal) ...@@ -181,6 +181,7 @@ stepd_signal_container(step_loc_t step, void *auth_cred, int signal)
Buf buf; Buf buf;
int buf_len; int buf_len;
int rc; int rc;
int errnum = 0;
fd = step_connect(step); fd = step_connect(step);
if (fd == -1) if (fd == -1)
...@@ -197,11 +198,13 @@ stepd_signal_container(step_loc_t step, void *auth_cred, int signal) ...@@ -197,11 +198,13 @@ stepd_signal_container(step_loc_t step, void *auth_cred, int signal)
safe_write(fd, &buf_len, sizeof(int)); safe_write(fd, &buf_len, sizeof(int));
safe_write(fd, get_buf_data(buf), buf_len); safe_write(fd, get_buf_data(buf), buf_len);
/* Receive the return code */ /* Receive the return code and errno */
safe_read(fd, &rc, sizeof(int)); safe_read(fd, &rc, sizeof(int));
safe_read(fd, &errnum, sizeof(int));
free_buf(buf); free_buf(buf);
close(fd); close(fd);
errno = errnum;
return rc; return rc;
rwfail: rwfail:
close(fd); close(fd);
......
...@@ -121,7 +121,7 @@ pid_t stepd_daemon_pid(step_loc_t step); ...@@ -121,7 +121,7 @@ pid_t stepd_daemon_pid(step_loc_t step);
#define safe_read(fd, ptr, size) do { \ #define safe_read(fd, ptr, size) do { \
if (read(fd, ptr, size) != size) { \ if (read(fd, ptr, size) != size) { \
error("%s:%d: %s: read (%d bytes) failed: %m", \ debug("%s:%d: %s: read (%d bytes) failed: %m", \
__FILE__, __LINE__, __CURRENT_FUNC__, \ __FILE__, __LINE__, __CURRENT_FUNC__, \
(int)size); \ (int)size); \
goto rwfail; \ goto rwfail; \
...@@ -130,7 +130,7 @@ pid_t stepd_daemon_pid(step_loc_t step); ...@@ -130,7 +130,7 @@ pid_t stepd_daemon_pid(step_loc_t step);
#define safe_write(fd, ptr, size) do { \ #define safe_write(fd, ptr, size) do { \
if (write(fd, ptr, size) != size) { \ if (write(fd, ptr, size) != size) { \
error("%s:%d: %s: write (%d bytes) failed: %m", \ debug("%s:%d: %s: write (%d bytes) failed: %m", \
__FILE__, __LINE__, __CURRENT_FUNC__, \ __FILE__, __LINE__, __CURRENT_FUNC__, \
(int)size); \ (int)size); \
goto rwfail; \ goto rwfail; \
......
...@@ -1068,7 +1068,7 @@ _kill_all_active_steps(void *auth_cred, uint32_t jobid, int sig, bool batch) ...@@ -1068,7 +1068,7 @@ _kill_all_active_steps(void *auth_cred, uint32_t jobid, int sig, bool batch)
debug2("container signal %d to job %u.%u", debug2("container signal %d to job %u.%u",
sig, jobid, stepd->stepid); sig, jobid, stepd->stepid);
if (stepd_signal_container(*stepd, auth_cred, sig) < 0) if (stepd_signal_container(*stepd, auth_cred, sig) < 0)
error("kill jid %d: %m", jobid); debug("kill jid %d: %m", jobid);
} }
list_iterator_destroy(i); list_iterator_destroy(i);
list_destroy(steps); list_destroy(steps);
......
...@@ -509,7 +509,8 @@ _handle_signal_container(int fd, slurmd_job_t *job) ...@@ -509,7 +509,8 @@ _handle_signal_container(int fd, slurmd_job_t *job)
debug("kill container req from uid %ld for job %u.%u " debug("kill container req from uid %ld for job %u.%u "
"owned by uid %ld", "owned by uid %ld",
(long)uid, job->jobid, job->stepid, (long)job->uid); (long)uid, job->jobid, job->stepid, (long)job->uid);
rc = EPERM; rc = -1;
errno = EPERM;
goto done; goto done;
} }
...@@ -519,7 +520,8 @@ _handle_signal_container(int fd, slurmd_job_t *job) ...@@ -519,7 +520,8 @@ _handle_signal_container(int fd, slurmd_job_t *job)
if (job->cont_id == 0) { if (job->cont_id == 0) {
debug ("step %u.%u invalid container [cont_id:%u]", debug ("step %u.%u invalid container [cont_id:%u]",
job->jobid, job->stepid, job->cont_id); job->jobid, job->stepid, job->cont_id);
rc = ESLURMD_JOB_NOTRUNNING; rc = -1;
errno = ESLURMD_JOB_NOTRUNNING;
goto done; goto done;
} }
...@@ -534,8 +536,9 @@ _handle_signal_container(int fd, slurmd_job_t *job) ...@@ -534,8 +536,9 @@ _handle_signal_container(int fd, slurmd_job_t *job)
} }
done: done:
/* Send the return code */ /* Send the return code and errno */
safe_write(fd, &rc, sizeof(int)); safe_write(fd, &rc, sizeof(int));
safe_write(fd, &errno, sizeof(int));
rwfail: rwfail:
return; return;
} }
......
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