Skip to content

Commit 96ff0f4

Browse files
authored
Merge pull request #5719 from grondo/shell.post-init
shell: add `shell.post-init` plugin calllback topic between `shell.init` and first `task.init`
2 parents 91bd396 + 73b47bb commit 96ff0f4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

doc/man1/flux-shell.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ execution of the job:
7171
* change working directory to the cwd of the job
7272
* enter a barrier to ensure shell initialization is complete on all shells
7373
* emit ``shell.init`` event to exec.eventlog
74+
* call ``shell.post-init`` plugin callbacks
7475
* create all local tasks. For each task, the following procedure is used
7576

7677
- call ``task.init`` plugin callback
@@ -142,6 +143,10 @@ topics:
142143
**jobspec** and **R** from the KVS, but before any tasks
143144
are started.
144145

146+
**shell.post-init**
147+
Called after the shell initialization barrier has completed, but
148+
before starting any tasks.
149+
145150
**task.init**
146151
Called for each task after the task info has been constructed
147152
but before the task is executed.

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)