emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sqlite3


From: Lars Ingebrigtsen
Subject: Re: sqlite3
Date: Mon, 27 Dec 2021 12:59:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> +      ;; 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)))

I don't think this is quite correct -- this means that an older version
of the file will be read (and overwrite a newer value) on Windows.

But I don't understand the analysis here -- according to your other
mail, the file always does exist in these tests.  True, there might be a
race condition here, but the file exists before the file-exists-p is
called, and it exists wen the --read-file-value is called, so it's
possible that there's a race condition.

But doesn't it seem more likely that it's the `file-attributes' call
here that returns outdated data on Windows?  That would explain all the
symptoms you're seeing, I think?  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]