]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
support: Set proper retransmit timeout for datagram transports
authorChuck Lever <chuck.lever@oracle.com>
Tue, 14 Jul 2009 20:18:37 +0000 (16:18 -0400)
committerSteve Dickson <steved@redhat.com>
Tue, 14 Jul 2009 20:18:37 +0000 (16:18 -0400)
Instead of setting the total timeout and the retransmit timeout to the
same value for datagram transports, use a 1 second retransmit timeout,
so we actually get a retransmit or two before failing.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nfs/rpc_socket.c

index a2255c304114ead58c975d884e203e62c88b1301..ac4e6d81c68849244e86d231155fbadbe805ca1d 100644 (file)
@@ -326,7 +326,9 @@ static CLIENT *nfs_get_udpclient(const struct sockaddr *sap,
                                        version, *timeout, &sock);
 #endif /* !HAVE_LIBTIRPC */
        if (client != NULL) {
-               CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, (char *)timeout);
+               struct timeval retry_timeout = { 1, 0 };
+               CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT,
+                                               (char *)&retry_timeout);
                CLNT_CONTROL(client, CLSET_FD_CLOSE, NULL);
        } else
                (void)close(sock);