SUNRPC: Handle EADDRINUSE on connect
Now that we're setting SO_REUSEPORT, we still need to handle the case where a connect() is attempted, but the old socket is still lingering. Essentially, all we want to do here is handle the error by waiting a few seconds and then retrying. Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
@@ -721,6 +721,7 @@ static int xs_tcp_send_request(struct rpc_task *task)
|
||||
xs_tcp_shutdown(xprt);
|
||||
case -ECONNREFUSED:
|
||||
case -ENOTCONN:
|
||||
case -EADDRINUSE:
|
||||
case -EPIPE:
|
||||
clear_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags);
|
||||
}
|
||||
@@ -2299,6 +2300,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
|
||||
case -ECONNREFUSED:
|
||||
case -ECONNRESET:
|
||||
case -ENETUNREACH:
|
||||
case -EADDRINUSE:
|
||||
case -ENOBUFS:
|
||||
/* retry with existing socket, after a delay */
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user