GNU bug report logs - #75209
30.0.93; Emacs reader failed to read data in "/home/nlj/.cache/org-persist/gc-lock.eld"

Previous Next

Package: emacs;

Reported by: "N. Jackson" <njackson <at> posteo.net>

Date: Mon, 30 Dec 2024 18:49:01 UTC

Severity: normal

Found in version 30.0.93

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 75209 <at> debbugs.gnu.org, njackson <at> posteo.net
Subject: bug#75209: 30.0.93; Emacs reader failed to read data in "/home/nlj/.cache/org-persist/gc-lock.eld"
Date: Sun, 05 Jan 2025 13:18:53 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> You are right. The only problem is short-living caches that should be
>> cleared at the end of Emacs session that created it.
>
> Does this mean you have ideas for solving this problem by reading the
> file before it is written?  Or does this mean you already read the
> file before writing to it?

The problem is that not every piece of cached data is stored in the
index on disk. Some caches should just live for the duration of Emacs
session that creates them.

Yet, other parallel Emacs sessions should not "GC" those transient
caches.

>> Org uses `with-temp-file'. Is there an alternative built-in and more
>> robust way to write string to file?
>
> Writing to a file is not atomic.  If you instead write to a temporary
> file, then rename it to the final file name, the renaming is atomic on
> Posix filesystems.
>
> This would mean you can still use with-temp-file, but with a temporary
> file name as its argument, and you need to add a single rename-file
> call afterwards.

That's fine. I just thought that there is some existing function doing
exactly this. If not, I can do it manually, of course.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.