Skip to content

Commit 9e5f5d3

Browse files
committed
job-exec: use idf58() convenience function
Problem: Several uses of flux_job_id_encode(3) in the job-exec module could be replaced by the simpler idf58() convenience function. Replace usage of flux_job_id_encode(3) wtih idf58() where appropriate throughout job-exec.
1 parent 2d2cf72 commit 9e5f5d3

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/modules/job-exec/exec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include <unistd.h>
3434

35+
#include "src/common/libjob/idf58.h"
3536
#include "ccan/str/str.h"
3637

3738
#include "job-exec.h"
@@ -462,8 +463,8 @@ static int exec_kill (struct jobinfo *job, int signum)
462463
}
463464

464465
flux_log (job->h, LOG_DEBUG,
465-
"exec_kill: %ju: signal %d",
466-
(uintmax_t) job->id,
466+
"exec_kill: %s: signal %d",
467+
idf58 (job->id),
467468
signum);
468469

469470
jobinfo_incref (job);

src/modules/job-exec/job-exec.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393

9494
#include "src/common/libczmqcontainers/czmq_containers.h"
9595
#include "src/common/libjob/job_hash.h"
96+
#include "src/common/libjob/idf58.h"
9697
#include "src/common/libeventlog/eventlog.h"
9798
#include "src/common/libeventlog/eventlogger.h"
9899
#include "src/common/libutil/fsd.h"
@@ -290,8 +291,8 @@ static int jobid_exception (flux_t *h, flux_jobid_t id,
290291

291292
flux_log (h,
292293
LOG_INFO,
293-
"job-exception: id=%ju: %s",
294-
(uintmax_t) id,
294+
"job-exception: id=%s: %s",
295+
idf58 (id),
295296
note);
296297
return flux_respond_pack (h, msg, "{s:I s:s s:{s:i s:s s:s}}",
297298
"id", id,
@@ -366,8 +367,8 @@ static void kill_shell_timer_cb (flux_reactor_t *r,
366367
struct jobinfo *job = arg;
367368
flux_log (job->h,
368369
LOG_DEBUG,
369-
"Sending SIGKILL to job shell for job %ju",
370-
(uintmax_t) job->id);
370+
"Sending SIGKILL to job shell for job %s",
371+
idf58 (job->id));
371372
(*job->impl->kill) (job, SIGKILL);
372373
}
373374

@@ -378,8 +379,8 @@ static void kill_timer_cb (flux_reactor_t *r, flux_watcher_t *w,
378379
flux_future_t *f;
379380
flux_log (job->h,
380381
LOG_DEBUG,
381-
"Sending SIGKILL to job %ju",
382-
(uintmax_t) job->id);
382+
"Sending SIGKILL to job %s",
383+
idf58 (job->id));
383384
if (!(f = flux_job_kill (job->h, job->id, SIGKILL))) {
384385
flux_log_error (job->h,
385386
"flux_job_kill (%ju, SIGKILL)",
@@ -1221,7 +1222,7 @@ static void exception_cb (flux_t *h, flux_msg_handler_t *mh,
12211222
* doesn't dump a duplicate exception into the eventlog.
12221223
*/
12231224
job->exception_in_progress = 1;
1224-
flux_log (h, LOG_DEBUG, "exec aborted: id=%ju", (uintmax_t)id);
1225+
flux_log (h, LOG_DEBUG, "exec aborted: id=%s", idf58 (id));
12251226
jobinfo_fatal_error (job, 0, "aborted due to exception type=%s", type);
12261227
}
12271228
}

0 commit comments

Comments
 (0)