Add timeout for I/O waitgroups

Closes #3286

This and a combination of a couple Docker changes are needed to fully
resolve the issue on the Docker side.  However, this ensures that after
processes exit, we still leave some time for the I/O to fully flush
before closing.  Without this timeout, the delete methods would block
forever.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2019-06-20 16:13:51 -04:00
parent 111b082e20
commit 245052243d
3 changed files with 21 additions and 2 deletions

View File

@@ -106,7 +106,7 @@ func (e *execProcess) Delete(ctx context.Context) error {
}
func (e *execProcess) delete(ctx context.Context) error {
e.wg.Wait()
waitTimeout(ctx, &e.wg, 2*time.Second)
if e.io != nil {
for _, c := range e.closers {
c.Close()