From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#39187: Fwd: "Package refresh is already in progress, please wait..." Date: Sun, 22 Mar 2020 12:40:36 +0100 Message-ID: <87imiw4nyj.fsf@stefankangas.se> References: <87muakus4m.fsf@marxist.se> <87iml2f34b.fsf@marxist.se> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="53355"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 39187@debbugs.gnu.org To: Jean-Christophe Helary Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 22 12:41:14 2020 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 1jFyyf-000Dn1-Eg for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Mar 2020 12:41:13 +0100 Original-Received: from localhost ([::1]:45344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFyye-0003wX-EI for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Mar 2020 07:41:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42006) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFyyW-0003wR-7F for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2020 07:41:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFyyU-0000hV-TB for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2020 07:41:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42667) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFyyU-0000hL-L7 for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2020 07:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jFyyU-0001HU-GB for bug-gnu-emacs@gnu.org; Sun, 22 Mar 2020 07:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Mar 2020 11:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39187 X-GNU-PR-Package: emacs Original-Received: via spool by 39187-submit@debbugs.gnu.org id=B39187.15848772474889 (code B ref 39187); Sun, 22 Mar 2020 11:41:02 +0000 Original-Received: (at 39187) by debbugs.gnu.org; 22 Mar 2020 11:40:47 +0000 Original-Received: from localhost ([127.0.0.1]:48640 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFyyF-0001Gm-Ae for submit@debbugs.gnu.org; Sun, 22 Mar 2020 07:40:47 -0400 Original-Received: from ted.gofardesign.uk ([67.225.143.91]:35346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFyyD-0001GY-K0 for 39187@debbugs.gnu.org; Sun, 22 Mar 2020 07:40:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uDEjDJR3DdJJRRTqwyjtufpnzEuk21JebMEF+bq3zJ0=; b=IWtqTEOkKZaJ0AA3/f+/LqJ25w XdCvoK5Mjs8ATeICJvKRnPWvMW006tuE8n8o4rjOl2vDIz/ZwKTGNrpH+QQ0vk6Frvm87OkBo+uGK r0aT791vI0hDoKJJ5dvuT0UQN6SSnG/7r3JoQ/LSeCboJQUS/l+3jSeY0ZfpgMURclKzlzGBYrsbQ iZ2RyJiDA3Rrvm3fla1ixgxi5PvZkiasrFTG8k+ho50wEvb8Q4yWj3ti0Li/7EbOuWPKf4LAoOR+l ss9ymM/pZKu9i7S9cLWbh+9i/4yV7qibANo+IfIWG6Fvt5oH39VUyX3vWIr1baifkAp/XFhdyrzqK R9Y/vAbw==; Original-Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:55290 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jFyy6-000Y3N-IC; Sun, 22 Mar 2020 07:40:38 -0400 In-Reply-To: <87iml2f34b.fsf@marxist.se> (Stefan Kangas's message of "Thu, 23 Jan 2020 19:18:28 +0100") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" Xref: news.gmane.io gmane.emacs.bugs:177617 Archived-At: Stefan Kangas writes: >>> > It looks like emacs does not properly handle package refreshes when >>> > the internet connection has been killed in the middle of an >>> > refresh. >>> > >>> > I often get this message in that case and I can't call package >>> > until I actually kill emacs and restart it. > [...] >> I think the fix here is simply to make sure that these processes times >> out. > > Unless I'm missing something, it turns out that this is not that easy > to do. At least I couldn't figure out how to do it. I found the > following probably relevant bug: > > bug#34607: url-retrieve-synchronously: TIMEOUT option value takes no effect > > For now at least, I'm giving up on finding a solution where url does > the right thing and times out. > > ----- > > I see two ways forward: > > 1. Remove the warning and accept that we might launch several > processes doing the same update one after the other. I would like > to avoid that on master, but it might be the least intrusive change > for emacs-27. > > 2. When we run a refresh, save the current time. If the user tries to > run another refresh, check if more than X seconds has elapsed since > the old one was started. If it has been more than X seconds, > prompt the user to kill the old refresh and re-launch it. It won't > be perfect, but it will be better than what we had before at least. > > Does anyone else have any ideas or preferences here? Otherwise, I'll > revert the change that exposed this bug on the emacs-27 branch, and > implement the second change on master. The more I've been looking at and thinking about this, the less convinced I've been that it's a good idea to do something like (2). It would not be a proper solution, but a hack, really. The correct fix would be to make sure the connection times out. But I'm not sure that it's worth going deep into the guts of url.el right now. Lars has been working on a replacement library (with-url) which AFAIU he hopes to merge in the coming months. Without having looked at it in great detail, it seems to me that we should try to make package.el use the with-url library once it's merged. Hopefully, that means that timeouts will work properly. (Otherwise, we can fix it.) Once timeouts work, it would then be easy to reintroduce the warning about duplicate package refreshes. I have consequently done (1) instead also on master: the commit is now reverted and this warning removed. Please test that it now works as expected, and thank you for your patience. Best regards, Stefan Kangas