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

Sebastian Krause <sebastian@realpath.org> writes:

> Hi,
>
> I have one IMAP and two NNTP servers configured in Gnus, all over
> SSL using the integrated GnuTLS. When I put my laptop into
> suspend-to-RAM for a while, the TCP connections will obviously drop
> eventually, but Gnus doesn't recognize this, so pressing 'g' after
> the system wake-up will cause Gnus to hang waiting for the TCP
> connections to respond. I usually resolve that by restarting Gnus
> with 'C-g' and 'R'.
>
> Is there a way for Gnus to quickly detect dropped TCP connections
> and transparently reconnect when I try to update the group list?

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

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". In fact, all you really need is:

(dolist (elem gnus-opened-servers)
  (gnus-close-server (car elem))
  (setcar (cdr elem) 'closed))

Eric



  reply	other threads:[~2016-10-15 17:46 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 [this message]
2016-10-15 18:47   ` Sebastian Krause
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=87bmylqzcy.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --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).