Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsubprocess: increase output watcher priority #6317

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/common/libsubprocess/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,13 @@ static int remote_channel_setup (flux_subprocess_t *p,
llog_debug (p, "flux_check_watcher_create: %s", strerror (errno));
goto error;
}

/* the output check should be called before other check
* callbacks, to ensure that the output buffer is emptied
* before any check callbacks that may move data into the
* buffer. So we up the priority of the output check
* watcher.
*/
flux_watcher_set_priority (c->out_check_w, 1);
/* don't start these watchers until we've reached the running
* state */
}
Expand Down Expand Up @@ -442,13 +448,6 @@ static int remote_output_buffered (flux_subprocess_t *p,
if (data && len) {
int tmp;

/* In the event the buffer is full, the `fbuf_write()` will
* fail. Call user callback to give them a chance to empty
* buffer. If they don't, we'll hit error below.
*/
if (!fbuf_space (c->read_buffer))
c->output_cb (c->p, c->name);

tmp = fbuf_write (c->read_buffer, data, len);
if (tmp >= 0 && tmp < len) {
errno = ENOSPC; // short write is promoted to fatal error
Expand Down
Loading