Skip to content

Commit 2a5b765

Browse files
committed
libsubprocess: allow server write before start
Problem: data written to the subprocess server before the subprocess has entered RUNNING state is silently discarded, but must be handled in order to eliminate extraneous buffering on the client size. Drop stdin data only when the subprocess is in FAILED or EXITED state.
1 parent 6300544 commit 2a5b765

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/libsubprocess/server.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,8 @@ static void server_write_cb (flux_t *h,
440440
* that the log messages end up being a nuisance.
441441
*/
442442
if (!(p = proc_find_byclient (s, msg))
443-
|| p->state != FLUX_SUBPROCESS_RUNNING)
443+
|| p->state == FLUX_SUBPROCESS_FAILED
444+
|| p->state == FLUX_SUBPROCESS_EXITED)
444445
goto out;
445446

446447
if (data && len) {

0 commit comments

Comments
 (0)