Skip to content

Commit

Permalink
libsubprocess: Fix guest watcher cancel race
Browse files Browse the repository at this point in the history
Fix a race in which the guest eventlog watcher cancels just as the guest
namespace is being deleted.  There is a small chance the user will never
see a ENODATA response.

Fixes #2331
  • Loading branch information
chu11 committed Aug 27, 2019
1 parent d70a50f commit 1838a2f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/modules/job-info/guest_watch.c
Expand Up @@ -611,6 +611,14 @@ static void guest_namespace_watch_continuation (flux_future_t *f, void *arg)
if (main_namespace_watch (gw) < 0)
goto error;
}
else if (gw->cancel) {
/* Racy scenario - user attempted a cancel right as
* ENOTSUP being sent. Caller won't get a ENODATA
* response b/c the original watcher is now dead.
*/
errno = ENODATA;
goto error;
}
return;
}
else {
Expand Down

0 comments on commit 1838a2f

Please sign in to comment.