From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/78771 Path: news.gmane.org!not-for-mail From: Greg Troxel Newsgroups: gmane.emacs.gnus.general Subject: Re: [gnus git] branch master updated: n0-17-27-g43f8466 =1= nntp.el (nntp-open-connection): Set TCP keepalive option. Date: Tue, 10 May 2011 08:06:54 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1305029311 4949 80.91.229.12 (10 May 2011 12:08:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 May 2011 12:08:31 +0000 (UTC) Cc: Stefan Monnier , ding@gnus.org To: Lars Magne Ingebrigtsen Original-X-From: ding-owner+M27072@lists.math.uh.edu Tue May 10 14:08:27 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QJljm-0005R8-Kg for ding-account@gmane.org; Tue, 10 May 2011 14:08:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1QJliZ-0003Pj-ME; Tue, 10 May 2011 07:07:11 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1QJliX-0003PU-P7 for ding@lists.math.uh.edu; Tue, 10 May 2011 07:07:09 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1QJliS-0004hA-Th for ding@lists.math.uh.edu; Tue, 10 May 2011 07:07:09 -0500 Original-Received: from linuxpal.mit.edu ([18.62.1.14]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1QJliR-0005F0-0g; Tue, 10 May 2011 14:07:03 +0200 Original-Received: by linuxpal.mit.edu (Postfix, from userid 9545) id 2A5E416074; Tue, 10 May 2011 08:07:00 -0400 (EDT) OpenPGP: id=098ED60E X-Hashcash: 1:20:110510:larsi@gnus.org::96gpG0FmtIiVZ2MU:0002BQl X-Hashcash: 1:20:110510:monnier@iro.umontreal.ca::60er4UG/J+cEjNqP:000000000000000000000000000000000000007/k X-Hashcash: 1:20:110510:ding@gnus.org::96gpG0FmtIiVZ2MU:00000blp In-Reply-To: (Lars Magne Ingebrigtsen's message of "Tue, 10 May 2011 00:53:06 +0200") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.2 (berkeley-unix) X-Spam-Score: -4.9 (----) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:78771 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Lars Magne Ingebrigtsen writes: >> + (when (and (fboundp 'set-network-process-option) >> + (eq (process-type process) 'network)) >> + ;; Use TCP-keepalive so that connections that pass through a NAT >> router >> + ;; don't hang when left idle. >> + (set-network-process-option process :keepalive t)) > > I don't necessarily disagree with this patch, but I'm wondering what the > use case is. > > Keepalive is usually useful (on the client side) if you have a protocol > where you're just sitting sleeping on a socket. If the server dies, > you'll never get a TCP RST, so the keepalive option will ensure you get > that RST after a while. > > However, the NNTP protocol isn't like that. You send a command and you > get a response. If you send a command to a server, and it doesn't > recognise you because you've changed IP address or whatever, it'll send > you a RST. I've seen a misguided firewall that breaks TCP connections after a while, and seen it cause trouble with gnus/nntp. Basically: gnus opens connection to server (across firewall) time passes =20=20 gnus sends data on the tcp connection firewall drops the data nothing else happens until the tcp connection times out In this particular case it's a firewall only, not NAT, but it's basically the same issue. > So the NNTP protocol doesn't seem like something that would need a > TCP keepalive option. But I might be misthinking the use case. I think you're assuming that the sender will discover the brokenness promptly. In the absence of broken middleboxes, that might be true. But then we wouldn't need keepalives at all. > (And, besides, if nntp.el needs keepalive, doesn't all network > connections need it?) That is a fair point. Another approach would be to have gnus have a timer so that it tears down news connections after some period of inactivity, like perhaps 600s. It seems that perhaps a gnus left idle for hours shouldn't have any open connections. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (NetBSD) iEYEARECAAYFAk3JKl4ACgkQH9p66AmO1g7AlgCfTfRi+kCMNNvXgF9ajLEgO0Bg wMQAn39ZOuY8/lxpklbrLqh8bx55DKsX =c3hY -----END PGP SIGNATURE----- --=-=-=--