From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#66993: [PATCH] project.el: avoid asking user about project-list-file lock Date: Wed, 08 Nov 2023 10:41:15 -0500 Message-ID: References: <83sf5g1lko.fsf@gnu.org> <9d460f36-6035-da54-3abc-12171ac8977f@gutov.dev> <83jzqs1hhx.fsf@gnu.org> <57c079bf-e3a3-db45-c45a-ad6925335e2f@gutov.dev> <83il6c1ct3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20753"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Dmitry Gutov , 66993@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 08 16:43:08 2023 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 1r0khw-00057X-7Q for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 08 Nov 2023 16:43:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0khR-0004ta-8D; Wed, 08 Nov 2023 10:42:37 -0500 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 1r0khK-0004qQ-Hv for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 10:42:30 -0500 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 1r0khD-0004dl-An for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 10:42:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r0khp-0004U8-S9 for bug-gnu-emacs@gnu.org; Wed, 08 Nov 2023 10:43:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 08 Nov 2023 15:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66993 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66993-submit@debbugs.gnu.org id=B66993.169945812617166 (code B ref 66993); Wed, 08 Nov 2023 15:43:01 +0000 Original-Received: (at 66993) by debbugs.gnu.org; 8 Nov 2023 15:42:06 +0000 Original-Received: from localhost ([127.0.0.1]:46168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0kgu-0004Sk-Em for submit@debbugs.gnu.org; Wed, 08 Nov 2023 10:42:06 -0500 Original-Received: from mxout5.mail.janestreet.com ([64.215.233.18]:34093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r0kgp-0004SE-NH for 66993@debbugs.gnu.org; Wed, 08 Nov 2023 10:42:03 -0500 In-Reply-To: <83il6c1ct3.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 08 Nov 2023 17:31:52 +0200") 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:273996 Archived-At: Eli Zaretskii writes: >> Date: Wed, 8 Nov 2023 15:56:11 +0200 >> Cc: sbaugh@janestreet.com, 66993@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 08/11/2023 15:50, Eli Zaretskii wrote: >> > Why do you need an error when you can use file-locked-p to check up >> > front that the file is locked? >> >> IIUC the problem comes due to concurrent writes from concurrent writes >> from parallel Emacs instances. >> >> Simply checking whether the file is locked before writing, without >> trying to obtain the lock, is unlikely to be a reliable solution >> (another instance might lock it right after we checked). >> >> Anyway, these writes must be very fast and relatively infrequent. So I'm >> surprised that this has came up, personally. > > If that's the case, just catch the error and retry, several times, > perhaps with variable delays. Perhaps, but it would be nice to do that by catching specifically file-locked rather than catching all errors. Which is something which can't be done right now, other than with the cl-flet approach in my original approach.