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: Fri, 17 Dec 2021 10:07:53 +0200 Message-ID: <83sfurejs6.fsf@gnu.org> References: <87tufmjyai.fsf@gnus.org> <87mtl13vz2.fsf@gnus.org> <87ilvp3tzo.fsf@gnus.org> <83wnk5gduf.fsf@gnu.org> <87r1ab1y0r.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39319"; 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 Fri Dec 17 09:10:00 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 1my8JS-000A0B-Il for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Dec 2021 09:09:58 +0100 Original-Received: from localhost ([::1]:52030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1my8JR-0002HM-Lo for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Dec 2021 03:09:57 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1my8Hg-0001JC-Pt for emacs-devel@gnu.org; Fri, 17 Dec 2021 03:08:09 -0500 Original-Received: from [2001:470:142:3::e] (port=38098 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 1my8Hg-0001hN-H8; Fri, 17 Dec 2021 03:08:08 -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=HHa1QwcGdJQ8Vi+wpPa2hAV0y56UA5liMFu8+gQ645M=; b=arHmSiODdxWg i/rBPC7TW78N/v09cgoB99UmPjO+L2eHyJGtw+Jf5U4R6/ZG4G3uAXyApq3f9wWiCKlpZfPlJgeJF MPb0AsgujmA8iF0ZjcGd3TG5vWk51dEM/sKeA7znl+J18pjo7tVsk7ZwrnehXsv/9XlB4m32nIL0t CIwuE8YZc8gwvnwukJAWOS/TIy4vLZdT5yqt6zziwt0n8dnRcOwGE3idnmUacdt0z9A+ZFva6LqJ5 Y6NnrE4OBW/dX1v4/MVEOqHjoUkgFu4roO7UcLz21PEbM+zjYIbZVreM/UZiTgIZDbroaQrA432ZX gwXDpNngrX6W2pHvhHc4Lw==; Original-Received: from [87.69.77.57] (port=4142 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 1my8Hg-00064C-Cb; Fri, 17 Dec 2021 03:08:08 -0500 In-Reply-To: <87r1ab1y0r.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 17 Dec 2021 08:38:44 +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:282198 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Fri, 17 Dec 2021 08:38:44 +0100 > > >> (file-error "Opening input file" "Permission denied" > >> "c:/Users/larsi/AppData/Local/Temp/emacs-test-nJO8TU-multisession/files/sbar/sbar.value") > > > > Is this code on master? If so, can you show some recipe to reproduce > > this? > > It's the multi-test-files-simple code in multisession-tests.el (but you > have to revert ed77d1a8c0 to see it). > > >> There's probably something about file locking on Windows that I don't > >> understand. > > > > Who does the file locking in this case, and by what means? > > That's what I don't know. > > What I think the code does is this: > > 1) First Emacs 1 writes the file. > 2) Then I start another Emacs, and it also writes the file, and then that > Emacs exits. > 3) Then Emacs 1 wants to read the file, and it fails with that error. > > If Emacs 1 waits a bit, then it's apparently allowed to open that file, > but I'm not quite sure about that. If Emacs 1 attempts to open and read the file while Emacs 2 still writes to it, Windows will not let Emacs 1 open the file, and the failure will be EACCES, as your report shows. That's because the default way of opening files which we use in Emacs opens them in "unshared" mode, so they cannot be shared between different processes. Which probably means multisession.el should have some mechanism to deal with this gracefully, like retrying the open/read several times before giving up. After all, the window for such races should be quite short, given that we write very small files.