unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 40748@debbugs.gnu.org
Subject: bug#40748: 28.0.50; Switching wifi networks hangs dns lookups
Date: Tue, 21 Apr 2020 10:10:54 -0700	[thread overview]
Message-ID: <878sio3gtd.fsf@ericabrahamsen.net> (raw)


I'm on Emacs master, but this behavior has been evident for quite some
time, a year or two I think.

I often have trouble reconnecting Gnus' nntp servers after sleeping the
laptop in one location, and waking it up in another, connecting to a new
wifi network (I'm using Arch linux, if it matters).

I edebugged `nntp-open-connection', and realized that the error (which
is getting handled by `nnheader-report', that's why I didn't notice it)
is actually a dns error:

(error "news.gmane.io/nntp Temporary failure in name resol...")

Other Emacs network connections behave as normal. But this error for
this particular server persists until I restart Emacs.

Are DNS lookups cached? Cached per connection? Is there anything we can
do to flush whatever's "stuck"?

Here's the code that opens the connection; in my case it's
nntp-open-network-stream/network.

Happy to help with further debugging!

(let ((coding-system-for-read 'binary)
      (coding-system-for-write 'binary)
      (map '((nntp-open-network-stream network)
	     (network-only plain)	; compat
	     (nntp-open-plain-stream plain)
	     (nntp-open-ssl-stream tls)
	     (nntp-open-tls-stream tls))))
  (if (assoc nntp-open-connection-function map)
      (open-network-stream
       "nntpd" pbuffer nntp-address nntp-port-number
       :type (cadr (assoc nntp-open-connection-function map))
       :end-of-command "^\\([2345]\\|[.]\\).*\n"
       :capability-command "HELP\r\n"
       :success "^3"
       :starttls-function
       (lambda (capabilities)
	 (if (not (string-match "STARTTLS" capabilities))
	     nil
	   "STARTTLS\r\n")))
    (funcall nntp-open-connection-function pbuffer)))





             reply	other threads:[~2020-04-21 17:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 17:10 Eric Abrahamsen [this message]
2020-07-03  4:11 ` bug#40748: 28.0.50; Switching wifi networks hangs dns lookups Dmitry Alexandrov
  -- strict thread matches above, loose matches on Subject: below --
2020-05-13 12:42 bug#41234: 27.0.91; Synchronous network requests are failing with “Name or service not known” Dmitry Alexandrov
2020-07-20 10:53 ` Lars Ingebrigtsen
2021-06-14 14:02   ` bug#40748: 28.0.50; Switching wifi networks hangs dns lookups Lars Ingebrigtsen
2021-12-23 22:09     ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=878sio3gtd.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=40748@debbugs.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).