Subject: Re: bug#40676: 28.0.50; gnus locks when reading email

From: Robert Pluim <[email-masked]>
Date: Sat, 18 Apr 2020 12:26:07 +0200

>>>>> On Fri, 17 Apr 2020 13:26:30 -0400, Alex Branham <[email-masked]> said:

    Alex> Thanks. I can't reproduce it that way. I don't think I have anything too
    Alex> terribly crazy in my gnus config but I'll try to make time to go through
    Alex> it.

My crystal ball says you have one or more of the gnus-gravatar
variables enabled, and you have a slow DNS, in which case customizing
'gravatar-service' to something other than 'libravatar will help.

(given the troubles the gravatar changes are causing, maybe we should
flip the default away from libravatar for the moment)

    >> What does list-processes display in that situation?

    Alex> Eli, the output of list-processes (removing some non-gnus related stuff) is:

    Alex> *nnimap*        --      open     *nnimap localhost nil  *nntpd** --           Main         (network connection to localhost:imap)
    Alex> dns             --      open     *temp*                   --           Main         (datagram connection to 192.168.1.1:domain)
    Alex> dns<1>          --      open     *temp*-198741            --           Main         (datagram connection to 192.168.1.1:domain)
    Alex> dns<2>          --      open     *temp*-84789             --           Main         (datagram connection to 192.168.1.1:domain)
    Alex> dns<3>          --      open     *temp*-23796             --           Main         (datagram connection to 192.168.1.1:domain)
    Alex> nntpd           --      open     *server news.gmane.io nntp  *nntpd** --           Main         (network connection to news.gmane.io:nntp)
    Alex> server          --      listen  --                        --           Main         (network server on /run/user/1000/emacs/server)

    Alex> At this point, gnus was complaining about the *temp*-23796 buffer
    Alex> process having a running process.

Although looking at the relevant code in dns.el, that should kill the
process unconditionally before killing the buffer, so I donʼt
understand why the process is still hanging around. It does:

          (condition-case nil
              (delete-process process)
            (error nil))

Sledgehammer patch to stop the querying below.

    Alex> I'm not sure if it's related, but recently-ish (after Emacs 26 but
    Alex> before Emacs 27) gnus asks me on every open a question concerning
    Alex> localhost certificates. I select "session".  Here's the output from the
    Alex> message buffer:

    Alex> Opening connection to localhost...
    Alex> Continue connecting? (always, session only, no, details, ?): 
    Alex> Accepting certificate for localhost:imap this session only.

Given that this is your local imap server, I think you can get away
with saying 'always', and the network security manager will stop
prompting.

Robert

diff --git a/lisp/net/dns.el b/lisp/net/dns.el
index 53ea0b19b5..4e0e1d1b0b 100644
--- a/lisp/net/dns.el
+++ b/lisp/net/dns.el
@@ -367,12 +365,13 @@ dns-make-network-process
 	  :coding 'binary
 	  :buffer (current-buffer)
 	  :host server
+          :noquery t
 	  :service "domain"
 	  :type 'datagram)