Subject: Re: bug#16026: Gnus shouldn't use old connections

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 25 Jan 2017 17:55:28 +0100

Ted Zlatanov <[email-masked]> writes:

> On Mon, 02 Dec 2013 11:12:20 -0500 Stefan Monnier <[email-masked]> wrote: 
>
>>>> Gnus should consider a connection as dead if it has been idle for more
>>>> than some timeout value (e.g. 5 minutes).  This bites me every day when
>>>> I wake up my computer: if I just hit `g' to refresh the *Group* buffer,
>>>> it *always* hangs (I guess it would timeout but only after a long wait,
>>>> like 2h).  Instead, I have to go to *Server*, close each server, go back
>>>> to *Group* and then hit `g'.

[...]

> In the Gnus mailing list we discussed an easy solution (just close all
> server connections before `g') but providing that as a user-level
> defcustom feels like giving up.  See http://thread.gmane.org/gmane.emacs.gnus.general/80262/focus=83843
>
> I suggested waiting for Lars' opinion.

There is `nntp-connection-timeout', and nnimap could have something
similar, I guess.

The difficulty is in determining what a good timeout should be.  If you
send an EXPUNGE to an IMAP server, it may legitimately take many
seconds, and you get no output from the server while it's doing this.
If you kill the connection and reissue the commands, you then get error
messages, I think?

But issuing EXPUNGE as the first thing after you haven't used a
connection in a while is unusual.  What usually happens is that you
enter an IMAP group, read a few messages, then your ISP decides that you
should change your IP number, and then you hit `q' which will normally
issue a marks updating command.  That should normally give a response
within a reasonable time.

If a command like that takes more than a few seconds, then we should
probably reconnect...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no