Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Sebastian Krause <sebastian@realpath.org>
To: info-gnus-english@gnu.org
Subject: Re: Transparently reconnect to servers after a system suspend
Date: Sat, 15 Oct 2016 20:47:38 +0200	[thread overview]
Message-ID: <m237jxcuut.fsf@news.realpath.org> (raw)
In-Reply-To: <87bmylqzcy.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 15 Oct 2016 10:46:37 -0700")

Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
> This has been annoying people for a very long time, but I don't think
> there's any clean solution to the problem. Gnus doesn't actually know
> that you've suspended and woken your computer, so it doesn't have any
> reason to suspect the connections are down. I think we'd have to ping
> servers on a timer, or maybe run a clock in lisp and periodically check
> it against system time (to see if execution was suspended for a while).
> Nothing immediately presents itself as The Right Solution, so no one's
> done anything...

I guess The Right Solution would be if Emacs would provide access to
the operating system's sleep/wake notifications (e.g. on macOS:
https://developer.apple.com/library/content/qa/qa1340/_index.html)
and tell Gnus about a system wakeup. Gnus could then just close all
connections each time it received such a notification. But it
doesn't look like there's anything like that in Emacs.

The second best thing I can think of is TCP keepalive with much
lower values for tcp_keepalive_time and tcp_keepalive_intvl. Gnus
actually enables :keepalive in its network sockets (e.g. in nntp.el
and nnimap.el), but the default values for the first keepalive
package on Linux and Windows is two hours of inactivity, and even
then it will take more than 10 minutes of no response until the OS
actually closes the connection. It's actually possible to lower the
keepalive parameters per socket, but again it doesn't seem like
Emacs provides the possibility to do that in elisp.

> A lighter-weight solution than a full restart is using "z", for
> gnus-group-suspend. That will close all the servers, which will be
> re-opened the next time you "g".

Weird, pressing "z" in the *Group* buffer just closes Gnus here.

Sebastian


  reply	other threads:[~2016-10-15 18:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-15  7:43 Sebastian Krause
2016-10-15 17:46 ` Eric Abrahamsen
2016-10-15 18:47   ` Sebastian Krause [this message]
2016-10-16  4:04     ` Eric Abrahamsen

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=m237jxcuut.fsf@news.realpath.org \
    --to=sebastian@realpath.org \
    --cc=info-gnus-english@gnu.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).