From owner-freebsd-net@FreeBSD.ORG Tue Aug 12 00:02:13 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65C09581; Tue, 12 Aug 2014 00:02:13 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 43DD9272B; Tue, 12 Aug 2014 00:02:12 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 54AF8D82; Mon, 11 Aug 2014 17:02:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1407801726; bh=ySEwImV61sOjSj9+CFifR6biedyMy1fgTynZ2MF6t8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=sMNOmDf5seHivOYhP3eN28FHsWoDLOtg4ZndqKmfFCysTZDt+aDLg0Hnby0k01M5N x0FG1Qn0o5SHcTcMaAWT9KHuR/+ICLy3ImHD79XT83QewAiLUtsGNvNqTxkFK7Q4p3 h/A9DxXFuwVglI/aKnjE9NzEOl1YoagtLSKzONEA= From: Peter Wemm To: freebsd-net@freebsd.org Subject: Re: zero window and persist timer not set Date: Mon, 11 Aug 2014 17:02:01 -0700 Message-ID: <24778594.oyrJY37Iyv@overcee.wemm.org> User-Agent: KMail/4.12.5 (FreeBSD/11.0-CURRENT; KDE/4.12.5; amd64; ; ) In-Reply-To: <201408111720.18544.jhb@freebsd.org> References: <201408111720.18544.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart26642615.nu2nT7dpWp"; micalg="pgp-sha1"; protocol="application/pgp-signature" Cc: Jeremiah Lott , John Baldwin X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 00:02:13 -0000 --nextPart26642615.nu2nT7dpWp Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Monday 11 August 2014 17:20:18 John Baldwin wrote: > On Wednesday, August 06, 2014 5:25:38 pm Jeremiah Lott wrote: > > Hello, > >=20 > > We've been seeing a problem where a tcp connection is stuck in a ze= ro > > window condition and even though the client has opened more window = space, > > our FreeBSD box never sends any more. After some analysis it appea= rs that > > the FreeBSD box is not sending zero window probes, because the pers= ist > > timer did not get set (we can see in kgdb that the tcpcb shows 0 wi= ndow, > > there is data in the socket buffer, but the persist timer is not ac= tive). [..] > > My proposed fix follows. If you send a 0-length packet, but there = is data > > is the socket buffer, and neither the rexmt or persist timer is alr= eady > > set, then activate the persist timer. > >=20 > > --- sys/netinet/tcp_output.c (revision 269644) > > +++ sys/netinet/tcp_output.c (working copy) > > @@ -1290,7 +1290,12 @@ > >=20 > > tp->t_rxtshift =3D 0; > > =20 > > } > > tcp_timer_activate(tp, TT_REXMT, tp->t_rxtc= ur); > >=20 > > - } > > + } else if (len =3D=3D 0 && so->so_snd.sb_cc && > > + !tcp_timer_active(tp, TT_REXMT) && > > + !tcp_timer_active(tp, TT_PERSIST)) { > > + tp->t_rxtshift =3D 0; > > + tcp_setpersist(tp); > > + } > >=20 > > } else { > > =20 > > /* > > =20 > > * Persist case, update snd_max but since we are in= > >=20 > > Let me know any comments. Thanks, >=20 > I think your patch is correct, but please file this as a bug report s= o we > can hopefully wrangle another person to review this. This sounds suspiciously like one of the failures we have been seeing b= etween=20 machines in the cluster that are doing package mirroring.. We had been= =20 attributing it to a mystery rsync bug but this seems to fit. It might = also=20 have been implicated in the svn mirroring too (eg: to the portsnap buil= der). =20 We've also had problems with ftp mirrors that also might fit this. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart26642615.nu2nT7dpWp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABAgAGBQJT6Vl+AAoJEDXWlwnsgJ4ELNMIAKWyuETT6yxO019zf/OAhwlZ c8HnD3tKuR/Uh+dcn45J1cDJEpxv+RxFNulbtq6nZomMUgdUAxV+cb+ajldDnb13 lXgtSb5F0hWJG/ihckad5Y5k1qEihNBEawP2uliObBhuZ3ntm9UBKWSEGZsusPIK uEG2LZIJdp369P7xdL0dcCpCWajRTfiMaJbJqAR8bUUPwzx+eVP9jBpURbRFAVUK yUBPHKkavu4kAG54dQoRcfHO09mmbBzuMl7WWOsCgGGYQK/aubS5Ry+fy82/3qJz vOop37kk7WcAwKBDVWTEmwR1E9OOlpAzmG5ciuDltDOmwKTFvZqbb3/ZnjNS0SI= =s7al -----END PGP SIGNATURE----- --nextPart26642615.nu2nT7dpWp--