* bug#40748: 28.0.50; Switching wifi networks hangs dns lookups
@ 2020-04-21 17:10 Eric Abrahamsen
2020-07-03 4:11 ` Dmitry Alexandrov
0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2020-04-21 17:10 UTC (permalink / raw)
To: 40748
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)))
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#41234: 27.0.91; Synchronous network requests are failing with “Name or service not known”
@ 2020-05-13 12:42 Dmitry Alexandrov
2020-07-20 10:53 ` Lars Ingebrigtsen
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Alexandrov @ 2020-05-13 12:42 UTC (permalink / raw)
To: 41234
[-- Attachment #1: Type: text/plain, Size: 1808 bytes --]
Dear maintainers,
Iʼm not sure whether that a bugreport or a support request, I hope you will excuse me for opting for the former.
Basically, I have an instance of Emacs 27 — rev. aea1b4db72 — a head of emacs-27 from about two weeks ago, which, have been running for that time, is failing to resolve any remote hostname synchronously (which, for instance, Gnus normally does), while asynchronous requests (as in ‘url-retrieve’) are still working fine.
A newly started instance of the same Emacs does not demonstrate the issue. And alas, despite being almost convinced, that I had already met this problem before, I cannot say how exactly to reproduce it.
However, I suppose, the fact, that this is by no means a pristine configuration is not much relevant, since the error goes down to C sources, namely to ‘make-network-process’:
(make-network-process :name " *net-test*"
:buffer (get-buffer-create " *net-test*")
:host "gnu.org" :service 80
:nowait nil)
;; Debugger entered--Lisp error: (error "gnu.org/80 Name or service not known")
More specifically, a call to getaddrinfo() in ‘network_lookup_address_info_1’ returns EAI_NONAME.
Could it be a problem in GNU Emacs, or have I broken my system somehow?
--
In GNU Emacs 27.0.91 (build 2, x86_64-pc-linux-gnu)
of 2020-04-30 built on nora
Repository revision: aea1b4db72df92595a3f642d18bf57254d74772b
Repository branch: emacs-27-nightly
System Description: Debian GNU/Linux 10 (buster)
Configured using:
'configure --with-x-toolkit=no'
Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB OLDXMENU X11 XDBE XIM MODULES THREADS LIBSYSTEMD PDUMPER LCMS2 GMP
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#41234: 27.0.91; Synchronous network requests are failing with “Name or service not known”
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
0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2020-07-20 10:53 UTC (permalink / raw)
To: Dmitry Alexandrov; +Cc: 41234
Dmitry Alexandrov <dag@gnui.org> writes:
> (make-network-process :name " *net-test*"
> :buffer (get-buffer-create " *net-test*")
> :host "gnu.org" :service 80
> :nowait nil)
> ;; Debugger entered--Lisp error: (error "gnu.org/80 Name or service not known")
>
> More specifically, a call to getaddrinfo() in ‘network_lookup_address_info_1’ returns EAI_NONAME.
>
> Could it be a problem in GNU Emacs, or have I broken my system somehow?
Dmitry Alexandrov <dag@gnui.org> writes:
> FWIW, strace suggests, that the problematic Emacs process is trying to
> connect to an outdated nameserver (from a LAN this machine was
> connected once):
[...]
> That is, that /etc/resolv.conf had not been reread (there is nothing
> about it in the skipped output above), while the instance that is
> working fine do check whether /etc/resolv.conf is updated:
Hm... since the async lookups work, I guess this means that
getaddrinfo_a works, but getaddrinfo doesn't? Which is very odd -- both
functions are supposed to update the name server etc in the same way, I
think?
So I'm not sure how this can be an Emacs bug -- as far as I know,
there's no way for libc clients to say "update all the DNS stuff now";
it's supposed to happen automatically when you call getaddrinfo. (If
I'm wrong, somebody please correct me.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#40748: 28.0.50; Switching wifi networks hangs dns lookups
2020-07-20 10:53 ` Lars Ingebrigtsen
@ 2021-06-14 14:02 ` Lars Ingebrigtsen
2021-12-23 22:09 ` Eric Abrahamsen
0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-06-14 14:02 UTC (permalink / raw)
To: Dmitry Alexandrov; +Cc: 40748, 41234
Lars Ingebrigtsen <larsi@gnus.org> writes:
> So I'm not sure how this can be an Emacs bug -- as far as I know,
> there's no way for libc clients to say "update all the DNS stuff now";
> it's supposed to happen automatically when you call getaddrinfo. (If
> I'm wrong, somebody please correct me.)
This was almost a year ago -- does anybody have any further input here?
If not, I'm not sure there's anything we can do from the Emacs side
here...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#40748: 28.0.50; Switching wifi networks hangs dns lookups
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
0 siblings, 0 replies; 4+ messages in thread
From: Eric Abrahamsen @ 2021-12-23 22:09 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 40748, Dmitry Alexandrov, 41234
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> So I'm not sure how this can be an Emacs bug -- as far as I know,
>> there's no way for libc clients to say "update all the DNS stuff now";
>> it's supposed to happen automatically when you call getaddrinfo. (If
>> I'm wrong, somebody please correct me.)
>
> This was almost a year ago -- does anybody have any further input here?
> If not, I'm not sure there's anything we can do from the Emacs side
> here...
I do not, and it doesn't seem to be happening any more! My bug can be
closed, but I'm not sure about 41234, which it's been merged with.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-12-23 22:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 17:10 bug#40748: 28.0.50; Switching wifi networks hangs dns lookups Eric Abrahamsen
2020-07-03 4:11 ` 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
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).