unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Aaron Zeng" <z@bcc32.com>
Cc: 71295@debbugs.gnu.org, azeng@janestreet.com, z@bcc32.com
Subject: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs
Date: Sat, 01 Jun 2024 22:38:36 +0300	[thread overview]
Message-ID: <86bk4ko3lv.fsf@gnu.org> (raw)
In-Reply-To: <af1ccfbd-beed-43a0-8d25-57fbaa20a1de@app.fastmail.com> (z@bcc32.com)

> Cc: Aaron Zeng <z@bcc32.com>, azeng@janestreet.com
> Date: Fri, 31 May 2024 12:21:55 -0400
> From: "Aaron Zeng" <z@bcc32.com>
> 
> 1. emacs -Q
> 2. Evaluate the following in the *scratch* buffer:
> 
>    (url-retrieve-synchronously "http://google.com:81" nil nil 1)
> 
> This does not time out in one second like the TIMEOUT argument
> specifies.  Instead, in my observations it hangs for at least several
> minutes.
> 
> This attempt also doesn't work:
> 
> 
> 3. (with-timeout (1) (url-retrieve-synchronously "http://google.com:81"))
> 
> As a consequence of this, Spacemacs's attempted timeout during Emacs
> startup can take ages if one of the package archives is temporarily
> unreachable, for example due to a network firewall that is enabled at
> my site.  Spacemacs attempts to timeout after only 5 seconds, but
> instead it takes minutes.

The timeout cannot work when Emacs is stuck in a system call trying to
initiate a network connection.  That is blocking, unless you use
url-retrieve asynchronously.  The timeout starts working after the
connection is established, so it basically protects against too slow
downloading of data after the initial connection.

I think it's a bug in Spacemacs that it attempts to solve connectivity
problems this way.





  reply	other threads:[~2024-06-01 19:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-31 16:21 bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs Aaron Zeng
2024-06-01 19:38 ` Eli Zaretskii [this message]
2024-06-04  0:09   ` Aaron Zeng
2024-06-06 11:40     ` Eli Zaretskii
2024-06-06 20:41       ` Dmitry Gutov
2024-06-07  6:20         ` Eli Zaretskii
2024-06-07 21:32           ` Dmitry Gutov
2024-06-08  6:08             ` Eli Zaretskii
2024-06-08 22:34               ` Dmitry Gutov
2024-06-09  4:39                 ` Eli Zaretskii
2024-06-09 22:05                   ` Dmitry Gutov

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=86bk4ko3lv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=71295@debbugs.gnu.org \
    --cc=azeng@janestreet.com \
    --cc=z@bcc32.com \
    /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).