• Chris Farmiloe's avatar
    net: fix socket leak in case of Dial failure · 4b749567
    Chris Farmiloe authored
    Socket descriptors are not closed when fd.connect() fails during generic socket creation.
    After a connection failure [ECONNREFUSED] descriptors are left in SYN_SENT state indefinitely (unless they get an explicit RST). Repeated failed connections will eventually cause your program to hit the user/system max-open-files limit.
    
    Fixes #2349.
    
    R=golang-dev, mikioh.mikioh
    CC=golang-dev
    https://golang.org/cl/5229047
    4b749567
sock.go 3.83 KB