From owner-freebsd-net@freebsd.org Thu Mar 18 21:02:23 2021 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAF7B5AD5C7 for ; Thu, 18 Mar 2021 21:02:23 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F1fbz5JcDz4n6v for ; Thu, 18 Mar 2021 21:02:23 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2a02:8109:1140:c3d:8eb:a851:167b:7a08] (unknown [IPv6:2a02:8109:1140:c3d:8eb:a851:167b:7a08]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id B7B3E762A0D40; Thu, 18 Mar 2021 22:02:19 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) Subject: Re: NFS Mount Hangs From: tuexen@freebsd.org In-Reply-To: Date: Thu, 18 Mar 2021 22:02:19 +0100 Cc: "Scheffenegger, Richard" , "freebsd-net@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <9EE3DFAC-72B0-4256-B57C-DE6AA811413C@freebsd.org> References: <3750001D-3F1C-4D9A-A9D9-98BCA6CA65A4@tildenparkcapital.com> <33693DE3-7FF8-4FAB-9A75-75576B88A566@tildenparkcapital.com> <2890D243-AF46-43A4-A1AD-CB0C3481511D@lurchi.franken.de> To: Rick Macklem X-Mailer: Apple Mail (2.3654.60.0.2.21) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4F1fbz5JcDz4n6v X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:680, ipnet:2001:638::/32, country:DE]; local_wl_from(0.00)[freebsd.org] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2021 21:02:24 -0000 > On 18. Mar 2021, at 21:55, Rick Macklem wrote: >=20 > Michael Tuexen wrote: >>> On 18. Mar 2021, at 13:42, Scheffenegger, Richard = wrote: >>>=20 >>>>> Output from the NFS Client when the issue occurs # netstat -an | = grep >>>>> NFS.Server.IP.X >>>>> tcp 0 0 NFS.Client.IP.X:46896 = NFS.Server.IP.X:2049 FIN_WAIT2 >>>> I'm no TCP guy. Hopefully others might know why the client would be = stuck in FIN_WAIT2 (I vaguely recall this means it is waiting for a = fin/ack, but could be wrong?) >>>=20 >>> When the client is in Fin-Wait2 this is the state you end up when = the Client side actively close() the tcp session, and then the server = also ACKed the FIN. > Jason noted: >=20 >> When the issue occurs, this is what I see on the NFS Server. >> tcp4 0 0 NFS.Server.IP.X.2049 NFS.Client.IP.X.51550 = CLOSE_WAIT >>=20 >> which corresponds to the state on the client side. The server = received the FIN >> from the client and acked it. >> The server is waiting for a close call to happen. >> So the question is: Is the server also closing the connection? > Did you mean to say "client closing the connection here?" Yes. >=20 > The server should call soclose() { it never calls soshutdown() } when > soreceive(with MSG_WAIT) returns 0 bytes or an error that indicates > the socket is broken. > --> The soreceive() call is triggered by an upcall for the rcv side of = the socket. > So, are you saying the FreeBSD NFS server did not call soclose() for = this case? Yes. If the state at the server side is CLOSE_WAIT, no close call has = happened yet. The FIN from the client was received, it was ACKED, but no close() call (or shutdown(..., SHUT_WR) or shutdown(..., SHUT_RDWR)) was issued. = Therefore, no FIN was sent and the client should be in the FINWAIT-2 state. This = was also reported. So the reported states are consistent. Best regards Michael >=20 > rick >=20 > Best regards > Michael >> This will last for ~2 min or so, but is asynchronous. However, the = same 4-tuple can not be reused during this time. >>=20 >> With other words, from the socket / TCP, a properly executed active = close() will end up in this state. (If the other side initiated the = close, a passive close, will not end in this state) >>=20 >>=20 >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" >=20 >=20 > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"