Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executor: fix deadlock in service exit from netns workers (#7610)
There was a race condition where contexts get canceled after a job is sent to the netns worker but before the result got read. This caused runInNetNS to exit (due to canceled context) but the result chan to never be read from. It was crucially an unbuffered chan, which resulted in the worker never being able to exit and the whole container cleanup to block indefinitely. The fix here is just to make that chan buffered with a size of 1 so that the worker doesn't ever get blocked trying to write to it. There's a few other related changes of making some other chans buffered and explicitly closing them with a defer (to handle panic cases) which aren't needed to fix this issue but seemed worth tidying up now. Signed-off-by: Erik Sipsma <[email protected]>
- Loading branch information