Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: closing all inactive server connections
Date: Thu, 16 Aug 2007 16:18:20 +0900	[thread overview]
Message-ID: <b4meji4ne0z.fsf@jpl.org> (raw)
In-Reply-To: <87zm0tyr2r.fsf@mocca.josefsson.org>

[-- Attachment #1: Type: text/plain, Size: 3046 bytes --]

>>>>> Simon Josefsson wrote:
> Katsumi Yamaoka <yamaoka@jpl.org> writes:

>> (while (and (memq (process-status PROCESS) '(open run))
>>             (wait-for-a-string-that-the-PROCESS-returns))
>>   (accept-process-output PROCESS 1)
>>   (sit-for 1))
>>
>> This can be an infinite loop if the process-status keeps `open'
>> or `run' even though the connection has actually died.

> Can that happen?  Wouldn't that be an emacs bug?  Shouldn't
> process-status return exit or closed if a connect/process has gone away?

I meant that the /connection/ is the one between the frontend of
Ted Zlatanov's local network (i.e., VPN) and the IMAP server (see
http://article.gmane.org/gmane.emacs.gnus.general/64906).  In his
case, the connection between Emacs and the frontend seems to be
alive even after the connection between the frontend and the IMAP
server dies.  So, ideally, what needs to be fixed should be
the VPN program, not be Emacs or Gnus, I think, and the plan I
proposed was no more than a workaround.  But I thought it was not
necessarily a bad idea even if the problem in the VPN program can
be solved soon, because people in the VPN networks might not
necessarily be able to ask the administrators to replace the
program with the corrected one.

>> In particular, the `imap-wait-for-tag' function can be the cause of
>> the hanging since it sends the LOGOUT command to the dead server and
>> waits for the response.  So, I tried modifying it so as to quit in a
>> certain time.  The patch to imap.el is below.  Anyway, it needs to be
>> reviewed by someone who is skilled in IMAP.  The default value of
>> `imap-timeout-seconds' might be too small for slow connections.

[...]

> This is a bad idea even for fast servers -- some operations (such as
> deleting or renaming a mailabox) can take several minutes.  Gnus
> shouldn't assume the server isn't responding in this (and other) cases.

Ok, but I didn't know it.

> Ted Zlatanov <tzz@lifelogs.com> writes:

>> 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.

> Having the timeout be restricted to just LOGOUT seems to make more sense
> to me.  If the server doesn't respond to a LOGOUT within a short period
> of time, one might as well disconnect.

I see.  It looks sufficient for Ted.

>>>>> Reiner Steib wrote:
> On Tue, Jul 31 2007, Katsumi Yamaoka wrote:

>> +(defvar imap-timeout-seconds 1
>> +  "*Number of seconds in which `imap-close' gives up working.")

> Nitpick: Either the "*" should be removed or it should be a defcustom.
> Shouldn't it?

I agree to making it use defcustom.  In addition, a good default
will probably be the value meaning there's no timeout.  Anyway I
use neither nnimap nor VPN at all, and I can neither reproduce
the problem nor verify this workaround.  So, I wish Simon and Ted
to take on this.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch for imap.el --]
[-- Type: text/x-patch, Size: 0 bytes --]



  reply	other threads:[~2007-08-16  7:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-07 15:59 Ted Zlatanov
2007-07-10 19:54 ` Ted Zlatanov
2007-07-19 13:46   ` Ted Zlatanov
2007-07-27 17:06     ` Ted Zlatanov
2007-07-28  0:18       ` Ted Zlatanov
2007-07-30  6:22         ` Katsumi Yamaoka
2007-07-30 15:39           ` Ted Zlatanov
2007-07-31  2:57             ` Katsumi Yamaoka
2007-07-31  3:08               ` Katsumi Yamaoka
2007-07-31  3:19                 ` Ted Zlatanov
2007-07-31  8:52                   ` Katsumi Yamaoka
2007-08-02 19:51                     ` Ted Zlatanov
2007-08-15 11:28                     ` Simon Josefsson
2007-08-16  7:18                       ` Katsumi Yamaoka [this message]
2007-08-16  7:25                         ` Katsumi Yamaoka
2007-08-16  9:49                         ` Simon Josefsson
2007-08-16 15:35                           ` Ted Zlatanov
2007-08-16 15:32                       ` Ted Zlatanov
2007-08-16 15:56                         ` Ted Zlatanov
2007-08-16 23:19                           ` Katsumi Yamaoka
2007-08-16 23:25                             ` Ted Zlatanov
2007-08-16 23:47                               ` Katsumi Yamaoka
2007-08-17 11:09                                 ` Katsumi Yamaoka
2007-09-10 14:52                                   ` Ted Zlatanov
2007-08-15 18:28                     ` Reiner Steib
2007-07-31  3:16               ` Ted Zlatanov
2007-07-31  3:19                 ` Katsumi Yamaoka
2007-07-31  2:58             ` untabify Lisp sources (was Re: closing all inactive server connections) Katsumi Yamaoka
2007-07-31 22:05               ` untabify Lisp sources Reiner Steib
2007-08-01  2:44                 ` Ted Zlatanov
2007-07-31 22:57               ` Miles Bader
2007-08-01  2:46                 ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4meji4ne0z.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).