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: Sun, 26 Dec 2021 14:55:20 +0200 Message-ID: <83pmpjo79j.fsf@gnu.org> References: <87tufmjyai.fsf@gnus.org> <83o85feitv.fsf@gnu.org> <87lf0jzifm.fsf@gnus.org> <83a6gze705.fsf@gnu.org> <87k0g2xsu9.fsf@gnus.org> <871r2axqp4.fsf@gnus.org> <83sfuqb5yo.fsf@gnu.org> <87fsqoyiao.fsf@gnus.org> <83v8zk96yh.fsf@gnu.org> <87zgowvmt5.fsf@gnus.org> <838rwg8z8i.fsf@gnu.org> <871r28vg4y.fsf@gnus.org> <834k748wez.fsf@gnu.org> <831r288vne.fsf@gnu.org> <83zgow7fpi.fsf@gnu.org> <83y24g7dui.fsf@gnu.org> <8735mnr5cb.fsf@gnus.org> <83bl19zwwy.fsf@gnu.org> <87bl18g7r3.fsf@gnus.org> <83ee64ych1.fsf@gnu.org> <83o853pydo.fsf@gnu.org> <875yrbzjc5.fsf@gnus.org> <8335mfpox7.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27362"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: larsi@gnus.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 26 13:56:03 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 1n1T4D-0006r7-Vb for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Dec 2021 13:56:01 +0100 Original-Received: from localhost ([::1]:45860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1T4C-0000Zo-3G for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Dec 2021 07:56:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:32952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1T3O-0008Kq-6C for emacs-devel@gnu.org; Sun, 26 Dec 2021 07:55:10 -0500 Original-Received: from [2001:470:142:3::e] (port=53450 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 1n1T3N-0002i4-PP; Sun, 26 Dec 2021 07:55:09 -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=on50vkvlPiNVOBLCtm4C7ZZB3b/q2cDwG0RNnMFc+CQ=; b=QSDHFE4ycD0m WkrlSE+6v/pqZZZG9b616IvSLcoXATNtVpRCEKCe1t05BRVhNy3eAHQ+ymzLwoxxO4mwsEx8a7Qx2 Tq2fv73Wnlr1nvrhLJUrz0HX7HeM30gEhTzOVE0UCgflqQs9i4IP5FHujoTr6tRrwhUdg+rLSJ8eU x+RCZJI6o7ymJj4kxKKqtlY+zj36/Z1Rzezz+mfBKqiE4h35vJ3+8FpK6jLWdDgobTGWAUKENy1Li Fn+SZLDmRve42gCAsq5Kr2QJUl/xkLvqTXtcjdKYNzzqqHOBMIDU05SqkdjVvpanhMGMFPkuYoTIg glTZ97GmWlJ9xNBlPbW5uQ==; Original-Received: from [87.69.77.57] (port=2056 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 1n1T3L-0001ca-3m; Sun, 26 Dec 2021 07:55:09 -0500 In-Reply-To: <8335mfpox7.fsf@gnu.org> (message from Eli Zaretskii on Sun, 26 Dec 2021 13:48:36 +0200) 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:283325 Archived-At: > Date: Sun, 26 Dec 2021 13:48:36 +0200 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > > Test multi-test-files-simple condition: > > > (ert-test-failed > > > ((should > > > (= > > > (multisession-value multisession--sfoo) > > > 2)) > > > :form > > > (= 1 2) > > > :value nil)) > > > > > > So I think the problem I'm seeing here is not that Emacs cannot access > > > the file, it's something else. Any ideas for digging into this? > > > > If you could get the test to cough up what's in the multisession > > directory when this happens, that would be helpful. > > I will try. I think I understand what happens here. It's a race condition (of course!). This code from multisession-backend-value: ;; We have a value, but we want to update in case some other ;; Emacs instance has updated. ((multisession--synchronized object) (if (and (file-exists-p file) (time-less-p (multisession--cached-sequence object) (file-attribute-modification-time (file-attributes file)))) (multisession--read-file-value file object) ;; Nothing, return the cached value. (multisession--cached-value object))) assumes that the file always exists. But on Windows, it sometimes doesn't. What I see is that if multisession-tests.el looks at the contents of the value file, it sees the updated value, even though the test fails because its value is before the update. Which means the Emacs session running the test didn't read the file at all. And note that multisession--read-file-value already tests for the file's existence, and retries if it doesn't exist. So I think we should simply restructure the code, and let multisession--read-file-value do the test and the waiting, and multisession-backend-value should just return the cached value if multisession--read-file-value failed to read the file.