From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs Date: Sat, 01 Jun 2024 22:38:36 +0300 Message-ID: <86bk4ko3lv.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30389"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 71295@debbugs.gnu.org, azeng@janestreet.com, z@bcc32.com To: "Aaron Zeng" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 01 21:42:22 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sDUcP-0007hy-E1 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Jun 2024 21:42:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sDUbw-0005Zr-2C; Sat, 01 Jun 2024 15:41:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDUbu-0005ZO-R0 for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2024 15:41:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sDUbu-0004AH-J1 for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2024 15:41:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sDUc5-0006sR-WE for bug-gnu-emacs@gnu.org; Sat, 01 Jun 2024 15:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Jun 2024 19:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71295 X-GNU-PR-Package: emacs Original-Received: via spool by 71295-submit@debbugs.gnu.org id=B71295.171727087326377 (code B ref 71295); Sat, 01 Jun 2024 19:42:01 +0000 Original-Received: (at 71295) by debbugs.gnu.org; 1 Jun 2024 19:41:13 +0000 Original-Received: from localhost ([127.0.0.1]:57451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDUbI-0006rN-W5 for submit@debbugs.gnu.org; Sat, 01 Jun 2024 15:41:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDUbG-0006rA-8N for 71295@debbugs.gnu.org; Sat, 01 Jun 2024 15:41:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDUYr-0003aP-Je; Sat, 01 Jun 2024 15:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=zynSucyl44eIL7E8tsV+Zdwrzb5pRwn3hyh50JmNSG8=; b=CWJ5MOw3vrJn 1PwFSTrfS2gOxU5RDXrVD1Uo7Bzw0ZLW3rSquCMuUnb+et7AsbMaf4WK/tTYOtGq/8eeFmsizw42I 3KMYWfH9smHFSm3HZqfG5p/no0SkUHlKUGV79qPv0ZchfA2k5M2OP0QTnt74wku+akIFEYFX9eesr wZeHWKJSFKhAuo7zSxAEllwVk/Cd4NRhro7gfqNiGMT/5Il0AbZ3AFgxRvG8WpwiD9IqYI4QhwSLs VwcaRCBcanhR9/XmJqBYuORHa87rvK27A9zunIDhYdKlGpcpIfGq7obsB2CN4PBrHQndvvebKq5e4 3yUP6prc/Kq20EODmE41Gg==; In-Reply-To: (z@bcc32.com) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286347 Archived-At: > Cc: Aaron Zeng , azeng@janestreet.com > Date: Fri, 31 May 2024 12:21:55 -0400 > From: "Aaron Zeng" > > 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.