mirror of https://github.com/minio/minio.git
server-mux: Keep listening after Accept() err (#3613)
Accept() can return errors like: `too many open files`, no need to totally quit listening in this case.
This commit is contained in:
parent
d1d89116f1
commit
fc6f804865
|
@ -191,20 +191,20 @@ func newListenerMux(listener net.Listener, config *tls.Config) *ListenerMux {
|
|||
}
|
||||
// Start listening, wrap connections with tls when needed
|
||||
go func() {
|
||||
// Extract tcp listener.
|
||||
tcpListener, ok := l.Listener.(*net.TCPListener)
|
||||
if !ok {
|
||||
l.acceptResCh <- ListenerMuxAcceptRes{err: errInvalidArgument}
|
||||
return
|
||||
}
|
||||
|
||||
// Loop for accepting new connections
|
||||
for {
|
||||
// Extract tcp listener.
|
||||
tcpListener, ok := l.Listener.(*net.TCPListener)
|
||||
if !ok {
|
||||
l.acceptResCh <- ListenerMuxAcceptRes{err: errInvalidArgument}
|
||||
return
|
||||
}
|
||||
|
||||
// Use accept TCP method to receive the connection.
|
||||
conn, err := tcpListener.AcceptTCP()
|
||||
if err != nil {
|
||||
l.acceptResCh <- ListenerMuxAcceptRes{err: err}
|
||||
return
|
||||
continue
|
||||
}
|
||||
|
||||
// Enable Read timeout
|
||||
|
|
Loading…
Reference in New Issue