From owner-svn-src-projects@freebsd.org Fri Jul 20 12:32:18 2018 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ABE0104423E for ; Fri, 20 Jul 2018 12:32:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1A407ACE8; Fri, 20 Jul 2018 12:32:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2E9810395; Fri, 20 Jul 2018 12:32:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6KCWHU2044858; Fri, 20 Jul 2018 12:32:17 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6KCWHTG044857; Fri, 20 Jul 2018 12:32:17 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201807201232.w6KCWHTG044857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 20 Jul 2018 12:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r336543 - projects/pnfs-planb-server/sys/rpc X-SVN-Group: projects X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: projects/pnfs-planb-server/sys/rpc X-SVN-Commit-Revision: 336543 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2018 12:32:18 -0000 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; }