Subject: bug#49682: 27.2.50; accept-process-output within accept-process-output hangs emacs

From: Rajeev N <[email-masked]>
Date: Mon, 26 Jul 2021 15:54:42 -0400

For me the following also hangs emacs.  The problem seems to me that (accept-process-output stream 0.05) in network-stream-get-response does not return even though it has a timeout of .05.

(let ()
  (run-with-timer 0 nil #'url-retrieve "https://www.gnu.org/" #'ignore)
  (make-process :name "echo" :command '("echo")
		:sentinel (lambda (_p _e)
			    (with-current-buffer (generate-new-buffer " *debug")
			      (run-with-timer 0 nil #'open-network-stream
					      "testing" (current-buffer) "smtp.gmail.com" 587
					      :type 'starttls
					      :return-list t
					      :warn-unless-encrypted t
					      :capability-command "EHLO www.gnu.org\r\n"
					      :end-of-command "^[0-9]+ .*\r\n"
					      :success "^2.*\n"
					      :always-query-capabilities t
					      :starttls-function
					      (lambda (capabilities)
						(and (string-match "[ -]STARTTLS" capabilities)
						     "STARTTLS\r\n"))
					      :client-certificate t
					      :use-starttls-if-possible t)))))

On Mon, 26 Jul 2021 at  9:58 pm +0300, Dmitry Gutov wrote:

#+begin_quote
 On 23.07.2021 20:00, Rajeev N via Bug reports for GNU Emacs, the Swiss
 army knife of text editors wrote:

> (let ()
>    (run-with-timer 0 nil #'url-retrieve"https://www.gnu.org/"  #'ignore)
>    (make-process :name "echo" :command '("echo")
>     :sentinel (lambda (_p _e) (run-with-timer 0 nil #'diary-mail-entries))))

 Any chance you have an example of the problem that doesn't require
 SMTP/Mail/Gnus to be configured in Emacs?
#+end_quote