rcrowley / goagain

Zero-downtime restarts in Go
Other
2.1k stars 144 forks source link

Fix double-close of FD on garbage collection (#25) #28

Open mtharp opened 8 years ago

mtharp commented 8 years ago

Fixes a rogue close() that happens whenever the GC next runs after Listen(). NewFile() takes responsibility for the fd it is passed but Listen() then proceeds to manually syscall.Close() the fd anyway. So when the file object gets finalized it is closed a second time, either causing an EBADF or closing some other random file.