From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#71295: 29.3; url-retrieve-synchronously does not timeout if initial connection hangs Date: Sun, 9 Jun 2024 01:34:03 +0300 Message-ID: <57c87a3e-d2bc-45aa-9c67-5ad62e82481f@gutov.dev> References: <86bk4ko3lv.fsf@gnu.org> <19e5cb88-48a2-46a2-b9e9-c4a9c9198bb5@app.fastmail.com> <86plsuguzu.fsf@gnu.org> <86sexpff50.fsf@gnu.org> <362fabaa-0b96-42eb-8b97-b17a86a121cb@gutov.dev> <86r0d8dl08.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40147"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: z@bcc32.com, 71295@debbugs.gnu.org, azeng@janestreet.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 09 00:35:03 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 1sG4eM-000A8l-2g for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Jun 2024 00:35:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sG4e8-0001zB-DP; Sat, 08 Jun 2024 18:34:48 -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 1sG4e6-0001ya-FU for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 18:34:46 -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 1sG4e6-0005J6-6p for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 18:34:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sG4eM-000632-1N for bug-gnu-emacs@gnu.org; Sat, 08 Jun 2024 18:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Jun 2024 22:35:02 +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.171788607423178 (code B ref 71295); Sat, 08 Jun 2024 22:35:02 +0000 Original-Received: (at 71295) by debbugs.gnu.org; 8 Jun 2024 22:34:34 +0000 Original-Received: from localhost ([127.0.0.1]:44440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG4dt-00061m-Jw for submit@debbugs.gnu.org; Sat, 08 Jun 2024 18:34:33 -0400 Original-Received: from fout2-smtp.messagingengine.com ([103.168.172.145]:51961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sG4do-00061J-3Y for 71295@debbugs.gnu.org; Sat, 08 Jun 2024 18:34:31 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 83B5213800A6; Sat, 8 Jun 2024 18:34:06 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 08 Jun 2024 18:34:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1717886046; x=1717972446; bh=6aMAn5Ypqpehk3qXriSJZezYbLNFS5n9OWv+HRbQTzw=; b= esTD4P+ovGUYb388ljWAFbvpKw7KEAyqxCejf+wSMNv5YSL9N8xv3aMhdc/MK5Fw djnyYxA9gJ05IXgj/GfkL9eJBYAurbaT75deir564cNADylJWwQmuh34fU+YfOVy KwZ5Mhjh4LsRDntST5W/ry6kRT95L8g925lAnYZvA1WAx5xnbYyedV9zrMm0y5UU 2X5MWg3KNZzffbr0CUFeyeW3O1QUBkhylXpljJegiJva93HrbkGpM2aFyNva8kfi NS+5Hkr8mCUSQoYMhznmaQdkmpimlohecZfT6vA8ZPDr8Sg0um1vhaiuxaRsc9L9 1nSHsVyqZ3XU/H6r1H2qLg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1717886046; x= 1717972446; bh=6aMAn5Ypqpehk3qXriSJZezYbLNFS5n9OWv+HRbQTzw=; b=Y NeqAna6dbfyrjy06LoKydggE3JzicmGawDsgiCc27FVzjyp3jy9G4OvFyM4jp+ZN DhSIt8GbIDx3HaNDUUoOkE/0PbdQQIMByyU6pDHwaC+HWUf4HlI1qwwtsdgzbTso xWfiiTDulhsUVgwk2jS21UvKyRmGcKL54LvNKN6PthyMdBDOgpHB9OhMlF5BfV4/ 2ppJl58XBAijR9n5rO+cRh/ur196DJSPdx/Fi/0aaj7dH2TVI624nb+yREVgYcCE XdLiGVMtl+Lb+/hxO94JkDYenBOz7jfTOn+VhliMzD4ut871qFyb+6gSNOtjq+F0 +/bFYKHdWxiLod8onHKJg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedthedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedu jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 8 Jun 2024 18:34:04 -0400 (EDT) Content-Language: en-US In-Reply-To: <86r0d8dl08.fsf@gnu.org> 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:286897 Archived-At: On 08/06/2024 09:08, Eli Zaretskii wrote: >> This seems to work: >> >> diff --git a/lisp/url/url.el b/lisp/url/url.el >> index dea251b453b..3b4021ceca8 100644 >> --- a/lisp/url/url.el >> +++ b/lisp/url/url.el >> @@ -235,7 +235,7 @@ url-retrieve-synchronously >> TIMEOUT is passed, it should be a number that says (in seconds) >> how long to wait for a response before giving up." >> (url-do-setup) >> - (let* (url-asynchronous >> + (let* ((url-asynchronous t) >> data-buffer >> (callback (lambda (&rest _args) >> (setq data-buffer (current-buffer)) > > Fine by me to install this on master, but please add there a comment > explaining why we do that disregarding the "synchronously" part of the > API's name. > > Did you consider binding url-asynchronous non-nil only if TIMEOUT is > omitted or nil? That could be even better, since the risk of breaking > something is lower, and OTOH if TIMEOUT is not passed, the original > problem does not exist and waiting "forever" is justified. WDYT? That's a good idea. Pushed to master, with this addition and a comment. Thinking further, though, our ability to do so bring the existence of this variable into question (we only change it in url-retrieve-synchronously). I see it's been added as part of bug#26835 resolution, so maybe we'll need to re-examine that fix.