Skip to content

Commit

Permalink
ctlsock: don't Warn() on closed socket
Browse files Browse the repository at this point in the history
This Warn() is causing panics in the test suite
on MacOS: #213
  • Loading branch information
rfjakob committed Feb 27, 2018
1 parent 5fcfd30 commit db45f27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/ctlsock/ctlsock_serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ func (ch *ctlSockHandler) acceptLoop() {
for {
conn, err := ch.socket.Accept()
if err != nil {
// TODO Can this warning trigger when the socket it closed on
// program exit? I have never observed it, but the documentation
// says that Close() unblocks Accept().
tlog.Warn.Printf("ctlsock: Accept error: %v", err)
// This can trigger on program exit with "use of closed network connection".
// Special-casing this is hard due to /~https://github.com/golang/go/issues/4373
// so just don't use tlog.Warn to not cause panics in the tests.
tlog.Info.Printf("ctlsock: Accept error: %v", err)
break
}
go ch.handleConnection(conn.(*net.UnixConn))
Expand Down

0 comments on commit db45f27

Please sign in to comment.