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.devel Subject: Re: sqlite3 Date: Sat, 18 Dec 2021 11:30:49 +0200 Message-ID: <83v8zmb6pi.fsf@gnu.org> References: <87tufmjyai.fsf@gnus.org> <87mtl13vz2.fsf@gnus.org> <87ilvp3tzo.fsf@gnus.org> <83wnk5gduf.fsf@gnu.org> <87r1ab1y0r.fsf@gnus.org> <83sfurejs6.fsf@gnu.org> <871r2b1vu8.fsf@gnus.org> <83o85feitv.fsf@gnu.org> <87lf0jzifm.fsf@gnus.org> <83a6gze705.fsf@gnu.org> <87k0g2xsu9.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39907"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 18 10:32:25 2021 Return-path: Envelope-to: ged-emacs-devel@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 1myW4n-000ACZ-BN for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 10:32:25 +0100 Original-Received: from localhost ([::1]:33604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1myW4l-0003Vg-Kw for ged-emacs-devel@m.gmane-mx.org; Sat, 18 Dec 2021 04:32:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myW3R-0002nb-Lx for emacs-devel@gnu.org; Sat, 18 Dec 2021 04:31:01 -0500 Original-Received: from [2001:470:142:3::e] (port=45078 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myW3R-0004kB-D2; Sat, 18 Dec 2021 04:31:01 -0500 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=HxfZgNR30oObXvAmb/QrK2TbTvHM3bUcA2RkcPOvDPQ=; b=seThXQzutlqJ b6VVRCfi1W1Y6/8oI6uwl/PGzzh/5CN/C62LEI1BZquG+PNqtg2bUbk4MLuoW5tV3ViDdyQf119A6 c/LVCvcMx7jjTWmSBBrEGcX8wyMq5OBHmi7XxM+4cXpyNtWkJNpbtt2YJQWVwGmJNU8XYIzKPqvFe mcmPub5znV9bC361BQmDBhdvKAQTOvW0gNsMYW3TpU0zf1vfoQEbg4R2iOpYWLHw6j1AFVNEt7I1U jJJweLI27vdAFtmzX4jrLs2ozWNjmFI02idrTlxHTDQ+uZjE+zvdPfn2i4lPIygNtOEjDGN82UF/V 3JOz0vdGtTFhrytjFZQ7WQ==; Original-Received: from [87.69.77.57] (port=2320 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1myW3R-0003z0-8c; Sat, 18 Dec 2021 04:31:01 -0500 In-Reply-To: <87k0g2xsu9.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 18 Dec 2021 08:41:50 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:282270 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Sat, 18 Dec 2021 08:41:50 +0100 > > Eli Zaretskii writes: > > > Which sounds like a problem different from what you saw? > > It may stem from the (incomplete) fix I added for the original problem, > though. > > > Adding (sleep-for 3) after call-process doesn't entirely fix the > > problem, although it becomes more rare. > > > > I've installed a change in multisession.el that makes the problem much > > more rare by forcing 'fsync' when we close the value file. The > > problem is not yet gone entirely, though: it happens with about 25% > > probability here. I think it could be related to the fact that > > 'rename-file' is not an atomic operation on MS-Windows. But that's a > > wild guess, I have no basis for it. > > Right. I'll do some further testing, but the real fix is to add some > backoff logic when the file is locked, which I'll do now. (And in that > case, I think the `fsync' should be unnecessary.) With the current master, the test still fails for me about 20% of the time. Seems like slightly less than before your recent changes, but I'm not sure. I think fsync should be necessary because we use temporary files, and those are by default not fsync'ed when we close the descriptor to which we wrote. At least on MS-Windows, I think this could mean other processes might get a stale file contents.