Skip to content

Commit 92a0310

Browse files
committed
libsubprocess: set channel flag only when needed
Problem: libsubprocess sets the SUBPROCESS_REXEC_CHANNEL flag for a remote subprocess if the on_channel_out callback is registered, but some users (like job-exec) may register a callback and not request any channels, and then a subprocess server implementation that doesn't support channels will balk. Only set that flag when subprocess channels have been defined.
1 parent af619fb commit 92a0310

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/libsubprocess/remote.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ int remote_exec (flux_subprocess_t *p)
601601
flux_future_t *f;
602602
int flags = 0;
603603

604-
if (p->ops.on_channel_out)
604+
if (zlist_size (cmd_channel_list (p->cmd)) > 0)
605605
flags |= SUBPROCESS_REXEC_CHANNEL;
606606
if (p->ops.on_stdout)
607607
flags |= SUBPROCESS_REXEC_STDOUT;

0 commit comments

Comments
 (0)