mirror of
https://github.com/moby/moby.git
synced 2026-08-07 16:41:50 +00:00
Ignore SIGPIPE events, resolves #19728
Using golang 1.6, is it now possible to ignore SIGPIPE events on stdout/stderr. Previous versions of the golang library cached 10 events and then killed the process receiving the events. systemd-journald sends SIGPIPE events when jounald is restarted and the target of the unit file writes to stdout/stderr. Docker logs to stdout/stderr. This patch silently ignores all SIGPIPE events. Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
@@ -127,6 +127,11 @@ func (cli *DaemonCli) start() (err error) {
|
||||
stopc := make(chan bool)
|
||||
defer close(stopc)
|
||||
|
||||
signal.Trap(func() {
|
||||
cli.stop()
|
||||
<-stopc // wait for daemonCli.start() to return
|
||||
})
|
||||
|
||||
// warn from uuid package when running the daemon
|
||||
uuid.Loggerf = logrus.Warnf
|
||||
|
||||
@@ -280,11 +285,6 @@ func (cli *DaemonCli) start() (err error) {
|
||||
serveAPIWait := make(chan error)
|
||||
go api.Wait(serveAPIWait)
|
||||
|
||||
signal.Trap(func() {
|
||||
cli.stop()
|
||||
<-stopc // wait for daemonCli.start() to return
|
||||
})
|
||||
|
||||
// after the daemon is done setting up we can notify systemd api
|
||||
notifySystem()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user