From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65013 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: closing all inactive server connections Date: Thu, 02 Aug 2007 15:51:09 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186084340 1284 80.91.229.12 (2 Aug 2007 19:52:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 2 Aug 2007 19:52:20 +0000 (UTC) Cc: ding@gnus.org, Simon Josefsson To: Katsumi Yamaoka Original-X-From: ding-owner+M13523@lists.math.uh.edu Thu Aug 02 21:52:14 2007 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.50) id 1IGgiT-0005pO-M6 for ding-account@gmane.org; Thu, 02 Aug 2007 21:52:14 +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 1IGgiA-0001GP-5Q; Thu, 02 Aug 2007 14:51:54 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IGgi8-0001G0-5c for ding@lists.math.uh.edu; Thu, 02 Aug 2007 14:51:52 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IGgi1-0006bU-Ut for ding@lists.math.uh.edu; Thu, 02 Aug 2007 14:51:52 -0500 Original-Received: from blockstar.com ([170.224.69.95] helo=mail.blockstar.com) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IGgi0-0007cA-00 for ; Thu, 02 Aug 2007 21:51:45 +0200 Original-Received: from tzz (unknown [69.25.70.4]) by mail.blockstar.com (Postfix) with ESMTP id E22BD3F84C5; Thu, 2 Aug 2007 12:58:06 -0700 (PDT) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: Katsumi Yamaoka , ding@gnus.org, Simon Josefsson In-Reply-To: (Katsumi Yamaoka's message of "Tue, 31 Jul 2007 17:52:42 +0900") User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (darwin) X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65013 Archived-At: On Tue, 31 Jul 2007 17:52:42 +0900 Katsumi Yamaoka wrote: >>>>>> Ted Zlatanov wrote: KY> --- nntp.el~ 2007-07-18 12:07:39 +0000 KY> +++ nntp.el 2007-07-31 03:04:52 +0000 >> I tried it and the IMAP server still hangs. Maybe the fix is in >> nnimap.el? I haven't looked deeper into this issue but I'll be glad to >> debug things on my side. KY> Is the patch effective for the hanged nntp connections? My NNTP connections are OK. KY> Well, I tried looking into the IMAP code although I've never KY> used nnimap. And I found the functions that communicate with KY> the server all have the following form: KY> (while (and (memq (process-status PROCESS) '(open run)) KY> (wait-for-a-string-that-the-PROCESS-returns)) KY> (accept-process-output PROCESS 1) KY> (sit-for 1)) KY> This can be an infinite loop if the process-status keeps `open' KY> or `run' even though the connection has actually died. In KY> particular, the `imap-wait-for-tag' function can be the cause of KY> the hanging since it sends the LOGOUT command to the dead server KY> and waits for the response. So, I tried modifying it so as to KY> quit in a certain time. The patch to imap.el is below. Anyway, KY> it needs to be reviewed by someone who is skilled in IMAP. The KY> default value of `imap-timeout-seconds' might be too small for KY> slow connections. I tried this and it works fine. If Simon is around, he can take a look, but I tested it over 6 hours of IMAP/NNTP use and had no problems. If anyone else can verify that it works, this would be a great addition to Gnus. Maybe it should be generalized, however, to an IMAP timeout per (server, group name, command) combination (as a regex or a function), so you can assign "LOGOUT" a longer timeout with a slower server. This could also be a server tuning parameter for nnimap instead of an imap.el parameter. Thank you for the help! Ted