Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2018 12:32:17 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r336543 - projects/pnfs-planb-server/sys/rpc
Message-ID:  <201807201232.w6KCWHTG044857@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Jul 20 12:32:17 2018
New Revision: 336543
URL: https://svnweb.freebsd.org/changeset/base/336543

Log:
  Update the krpc code to what is in head/current.

Modified:
  projects/pnfs-planb-server/sys/rpc/clnt_rc.c
  projects/pnfs-planb-server/sys/rpc/clnt_vc.c

Modified: projects/pnfs-planb-server/sys/rpc/clnt_rc.c
==============================================================================
--- projects/pnfs-planb-server/sys/rpc/clnt_rc.c	Fri Jul 20 12:03:16 2018	(r336542)
+++ projects/pnfs-planb-server/sys/rpc/clnt_rc.c	Fri Jul 20 12:32:17 2018	(r336543)
@@ -175,6 +175,11 @@ clnt_reconnect_connect(CLIENT *cl)
 		    (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers,
 		    rc->rc_sendsz, rc->rc_recvsz);
 	else {
+		/*
+		 * I do not believe a timeout of less than 1sec would make
+		 * sense here since short delays can occur when a server is
+		 * temporarily overloaded.
+		 */
 		if (rc->rc_timeout.tv_sec > 0 && rc->rc_timeout.tv_usec >= 0) {
 			error = so_setsockopt(so, SOL_SOCKET, SO_SNDTIMEO,
 			    &rc->rc_timeout, sizeof(struct timeval));

Modified: projects/pnfs-planb-server/sys/rpc/clnt_vc.c
==============================================================================
--- projects/pnfs-planb-server/sys/rpc/clnt_vc.c	Fri Jul 20 12:03:16 2018	(r336542)
+++ projects/pnfs-planb-server/sys/rpc/clnt_vc.c	Fri Jul 20 12:32:17 2018	(r336543)
@@ -142,8 +142,6 @@ clnt_vc_create(
 	XDR xdrs;
 	int error, interrupted, one = 1, sleep_flag;
 	struct sockopt sopt;
-	struct timeval tv;
-	int timo;
 
 	if (disrupt == 0)
 		disrupt = (uint32_t)(long)raddr;
@@ -158,18 +156,6 @@ clnt_vc_create(
 	ct->ct_upcallrefs = 0;
 
 	if ((so->so_state & (SS_ISCONNECTED|SS_ISCONFIRMING)) == 0) {
-		/* Check for a timeout on the soconnect(). */
-		bzero(&sopt, sizeof(sopt));
-		sopt.sopt_dir = SOPT_GET;
-		sopt.sopt_level = SOL_SOCKET;
-		sopt.sopt_name = SO_SNDTIMEO;
-		sopt.sopt_val = &tv;
-		sopt.sopt_valsize = sizeof(tv);
-		error = sogetopt(so, &sopt);
-		timo = 0;
-		if (error == 0 && tv.tv_sec > 0 && tv.tv_sec <= 600 &&
-		    tv.tv_usec >= 0)
-			timo = hz * tv.tv_sec;
 		error = soconnect(so, raddr, curthread);
 		SOCK_LOCK(so);
 		interrupted = 0;
@@ -179,10 +165,9 @@ clnt_vc_create(
 		while ((so->so_state & SS_ISCONNECTING)
 		    && so->so_error == 0) {
 			error = msleep(&so->so_timeo, SOCK_MTX(so),
-			    sleep_flag, "connec", timo);
+			    sleep_flag, "connec", 0);
 			if (error) {
-				if (error == EINTR || error == ERESTART ||
-				    error == EAGAIN)
+				if (error == EINTR || error == ERESTART)
 					interrupted = 1;
 				break;
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807201232.w6KCWHTG044857>