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 16:57:57 +0200 Message-ID: <83h7avo1l6.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> <83pmpjo79j.fsf@gnu.org> <83ilvbo2ab.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14419"; 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 15:58:19 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 1n1UyY-0003Zz-Vd for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Dec 2021 15:58:19 +0100 Original-Received: from localhost ([::1]:52832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1UyX-0001se-4F for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Dec 2021 09:58:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1Uy0-0001DB-6a for emacs-devel@gnu.org; Sun, 26 Dec 2021 09:57:44 -0500 Original-Received: from [2001:470:142:3::e] (port=55436 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 1n1Uxz-00039L-Qk; Sun, 26 Dec 2021 09:57:43 -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=zBF4bBLFv/ZF6DUBSFZmWeWiEj45fB07GNarwZ/QDu4=; b=K8ocM3/t4Hkx /4zGvo7pKl4WI/zV1nK83kllb5JXygxP+4bdkiQYkNUiYTyeESa7hQYDYzL6QEKQfruEz0sMfGm05 yZcryefT0+et/qeccCLy83nCux8hGCm7HwY/n+wH9qXPmLpD5fbykOvwlWM5iEwjZVxZM5Fl6i6lg vg4E17wVCHxBYVZZ4zEAct4705j+DDx128srwYYCGE3CHXbggHjcu4/RwGn0t6jX37oMtSHc0pBAC aYM1Q5+jQr9cePOSuMlCmsxhjvjfdPYQ2fIINd+h1SQmZaC6o6ASo/ZewBJOiJuy16gtzJtuQ519I YidUmsvDpYdp0OF5V6NscQ==; Original-Received: from [87.69.77.57] (port=1722 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 1n1Uxz-00028Z-Pe; Sun, 26 Dec 2021 09:57:44 -0500 In-Reply-To: <83ilvbo2ab.fsf@gnu.org> (message from Eli Zaretskii on Sun, 26 Dec 2021 16:42:52 +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:283331 Archived-At: > Date: Sun, 26 Dec 2021 16:42:52 +0200 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > For example, with the simple changes below (which also make the sleep > between retries somewhat shorter), the test didn't fail even once in > 20 runs: Actually, this slightly different version is better: diff --git a/lisp/emacs-lisp/multisession.el b/lisp/emacs-lisp/multisession.el index c58a9ab..2dcddc2 100644 --- a/lisp/emacs-lisp/multisession.el +++ b/lisp/emacs-lisp/multisession.el @@ -275,7 +275,7 @@ multisession--read-file-value ((permission-denied file-missing) (setq i (1+ i) last-error err) - (sleep-for (+ 0.1 (/ (float (random 10)) 10)))))) + (sleep-for (+ 0.01 (* (float (random 10)) 0.01)))))) (signal (car last-error) (cdr last-error))))) (defun multisession--object-file-name (object) @@ -299,11 +299,19 @@ 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) + ;; On MS-Windows/MS-DOS, we could have race conditions whereby + ;; the value file might not exist for short windows of + ;; opportunity. So try reading the file on those systems if it + ;; doesn't exist or looks outdated, as our reading method can + ;; cope with some of those races. + (if (or (and (file-exists-p file) + (time-less-p (multisession--cached-sequence object) + (file-attribute-modification-time + (file-attributes file)))) + (memq system-type '(windows-nt ms-dos))) + (condition-case nil + (multisession--read-file-value file object) + (error (multisession--cached-value object))) ;; Nothing, return the cached value. (multisession--cached-value object))) ;; Just return the cached value.