Skip to content

Commit 99e433f

Browse files
committed
shell: use f58 jobid encoding for shell service
Problem: The shell service name uses the decimal encoding of the jobid as the suffix, but using the f58 encoding would make it more clear that the service corresponds directly to a job. Encode the jobid in the shell service name as f58. Since the job-exec module builds the shell service topic string by hand, update it as well.
1 parent f7c408c commit 99e433f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ flux_future_t *jobinfo_shell_rpc_pack (struct jobinfo *job,
174174
uint32_t rank;
175175

176176
if (asprintf (&shell_topic,
177-
"%ju-shell-%ju.%s",
177+
"%ju-shell-%s.%s",
178178
(uintmax_t) job->userid,
179-
(uintmax_t) job->id,
179+
idf58 (job->id),
180180
topic) < 0
181181
|| ((rank = resource_set_nth_rank (job->R, 0)) == IDSET_INVALID_ID))
182182
goto out;

src/shell/svc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#include <unistd.h>
3636
#include <flux/core.h>
3737

38+
#include "src/common/libjob/idf58.h"
39+
3840
#include "internal.h"
3941
#include "task.h"
4042
#include "svc.h"
@@ -66,9 +68,9 @@ static int build_topic (struct shell_svc *svc,
6668
{
6769
if (snprintf (buf,
6870
len,
69-
"%ju-shell-%ju%s%s",
71+
"%ju-shell-%s%s%s",
7072
(uintmax_t)svc->uid,
71-
(uintmax_t)svc->shell->info->jobid,
73+
idf58 (svc->shell->info->jobid),
7274
method ? "." : "",
7375
method ? method : "") >= len) {
7476
errno = EINVAL;

0 commit comments

Comments
 (0)