Skip to content

Commit 5958bc7

Browse files
committed
shell: add shell.post-init plugin callback
Problem: The job shell does not issue any plugin callbacks between shell.init and task.init for the first task, but this may be useful if a plugin wants to take an action after all shell.init callbacks have been run, but before the first task.init callback. Add a shell.post-init callback. This runs after the shell barrier is complete but before the shell begins launching tasks.
1 parent 91bd396 commit 5958bc7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/shell/shell.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,11 @@ static int shell_init (flux_shell_t *shell)
13871387
return plugstack_call (shell->plugstack, "shell.init", NULL);
13881388
}
13891389

1390+
static int shell_post_init (flux_shell_t *shell)
1391+
{
1392+
return plugstack_call (shell->plugstack, "shell.post-init", NULL);
1393+
}
1394+
13901395
static int shell_task_init (flux_shell_t *shell)
13911396
{
13921397
return plugstack_call (shell->plugstack, "task.init", NULL);
@@ -1618,6 +1623,11 @@ int main (int argc, char *argv[])
16181623
&& shell_eventlogger_emit_event (shell.ev, "shell.init") < 0)
16191624
shell_die_errno (1, "failed to emit event shell.init");
16201625

1626+
/* Call shell.post-init plugins.
1627+
*/
1628+
if (shell_post_init (&shell) < 0)
1629+
shell_die_errno (1, "shell_post_init");
1630+
16211631
/* Create tasks
16221632
*/
16231633
if (!(shell.tasks = zlist_new ()))

0 commit comments

Comments
 (0)