[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /
From: |
Ihor Radchenko |
Subject: |
Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)] |
Date: |
Fri, 17 May 2024 11:31:26 +0000 |
Greg Minshall <minshall@umich.edu> writes:
> i run various Emacs instances, in each of which i run org. i frequently
> get these messages (followed by errors when i reply 'q'):
> ----
> ...rg-persist/gc-lock.eld locked by minshall@arch... (pid 546721): (s, q, p,
> ?)?
> Error running timer ‘org-persist--refresh-gc-lock’: (file-locked
> "/home/minshall/.cache/org-persist/gc-lock.eld" "minshall@archlinux (pid
> 546721)")
> ----
>
> since i don't see a PID in the lock file name (i assume it is), i wonder
> if the code occasionally has this problem when more than one instance
> attempts to acquire this lock at a time?
In theory, the odds should be quite slim, unless you open that file
manually. Anyway...
Does the attached patch fix the problem for you?
>From 7f208e8802ed10017cce094114d395698523beec Mon Sep 17 00:00:00 2001
Message-ID:
<7f208e8802ed10017cce094114d395698523beec.1715945418.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Fri, 17 May 2024 14:28:48 +0300
Subject: [PATCH] lisp/org-persist.el: Ignore lock files when writing cache
* lisp/org-persist.el (org-persist--write-elisp-file): Unlock file
before writing cache.
Reported-by: Greg Minshall <minshall@umich.edu>
Link: https://orgmode.org/list/574109.1715751441@archlinux
---
lisp/org-persist.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 0df345536..a8fc77c95 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -481,7 +481,10 @@ (defun org-persist--write-elisp-file (file data &optional
no-circular pp)
(if pp
(let ((pp-use-max-width nil)) ; Emacs bug#58687
(pp data (current-buffer)))
- (prin1 data (current-buffer))))
+ (prin1 data (current-buffer)))
+ ;; Force writing even when the file happens to be opened by
+ ;; another Emacs process.
+ (unlock-buffer))
(org-persist--display-time
(- (float-time) start-time)
"Writing to %S" file)))
--
2.45.1
--
Ihor Radchenko // yantar92,
Org mode contributor,
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>
- [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Greg Minshall, 2024/05/15
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)],
Ihor Radchenko <=
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Greg Minshall, 2024/05/17
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Greg Minshall, 2024/05/18
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Ihor Radchenko, 2024/05/19
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Greg Minshall, 2024/05/22
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Ihor Radchenko, 2024/05/22
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Greg Minshall, 2024/05/22
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Greg Minshall, 2024/05/30
- Re: [BUG] cache file conflict? [9.7-pre (release_9.6.29-1441-gaa71fa @ /home/minshall/.emacs.d/straight/build/org/)], Ihor Radchenko, 2024/05/30