mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Merge pull request #28854 from coolljt0725/igore_close_stderr_error
Ignore "failed to close stdin" if container or process not found
This commit is contained in:
		
						commit
						f9ddac3f3c
					
				
					 2 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -135,7 +135,7 @@ func (c *Config) CopyToPipe(iop libcontainerd.IOPipe) {
 | 
			
		|||
			go func() {
 | 
			
		||||
				pools.Copy(iop.Stdin, stdin)
 | 
			
		||||
				if err := iop.Stdin.Close(); err != nil {
 | 
			
		||||
					logrus.Errorf("failed to close stdin: %+v", err)
 | 
			
		||||
					logrus.Warnf("failed to close stdin: %+v", err)
 | 
			
		||||
				}
 | 
			
		||||
			}()
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,6 +8,7 @@ import (
 | 
			
		|||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	goruntime "runtime"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	containerd "github.com/docker/containerd/api/grpc/types"
 | 
			
		||||
| 
						 | 
				
			
			@ -86,6 +87,9 @@ func (p *process) sendCloseStdin() error {
 | 
			
		|||
		Pid:        p.friendlyName,
 | 
			
		||||
		CloseStdin: true,
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil && (strings.Contains(err.Error(), "container not found") || strings.Contains(err.Error(), "process not found")) {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	return err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue