From 37396bf982aa7dd74083eca656712331e6bded00 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst-Satzkorn Date: Tue, 9 Jul 2024 09:56:03 -0700 Subject: [PATCH] Remove use of deprecated net.Error.Temporary net.Error.Temporary has been deprecated since Go 1.18. There has been some discussion around what to use in server accept loops instead [1], but the suggestion seems to be that it may be a mistake to have any sort of retries in place [2]. This PR removes it, which may expose some users to errors that were previously swallowed and retried, but at the expense of leaking file descriptors and the like. 1: https://groups.google.com/g/golang-nuts/c/-JcZzOkyqYI/m/xwaZzjCgAwAJ?pli=1 2: https://groups.google.com/g/golang-nuts/c/-JcZzOkyqYI/m/vNNiVn_LAwAJ --- server.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/server.go b/server.go index 81580d1e5..7a67cf3b4 100644 --- a/server.go +++ b/server.go @@ -476,9 +476,6 @@ func (srv *Server) serveTCP(l net.Listener) error { if !srv.isStarted() { return nil } - if neterr, ok := err.(net.Error); ok && neterr.Temporary() { - continue - } return err } srv.lock.Lock() @@ -535,9 +532,6 @@ func (srv *Server) serveUDP(l net.PacketConn) error { if !srv.isStarted() { return nil } - if netErr, ok := err.(net.Error); ok && netErr.Temporary() { - continue - } return err } if len(m) < headerSize {