go-tigertonic icon indicating copy to clipboard operation
go-tigertonic copied to clipboard

accept tcp 127.0.0.1:12345: use of closed network connection

Open proteneer opened this issue 11 years ago • 2 comments

I'm using the HEAD from master, and getting this error:

accept tcp 127.0.0.1:12345: use of closed network connection

(This is the error returned from Server.ListenAndServe(), and in turn net.Listen())

I'm trying to figure what exactly is trying to use it. Any ideas?

proteneer avatar Oct 17 '14 22:10 proteneer

I honestly don't. I've seen it in logs for non-Tiger Tonic services before, too, though, so the problem may be more subtle. Or it may not be a problem at all! ¯_(ツ)_/¯

rcrowley avatar Nov 08 '14 14:11 rcrowley

Can reproduce this using the graceful shutdown in example.go. It is logged during the Close() method.

    go func() {
        var err error
        err = server.ListenAndServe()
        if nil != err {
            log.Println(err)
        }
    }()

    ch := make(chan os.Signal)
    signal.Notify(ch, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGKILL)
    log.Println("Received system signal:", <-ch)
    log.Println("Closing")
    server.Close()
    log.Println("Done closing")

If at least one request has been served before I interrupt it will log the error:

2015/12/04 15:38:05 Received system signal: interrupt 2015/12/04 15:38:05 Closing 2015/12/04 15:38:05 accept tcp 127.0.0.1:8002: use of closed network connection 2015/12/04 15:38:05 Done closing

karmeye avatar Dec 04 '15 13:12 karmeye