-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recentf Save Gets Blocked by Interlocking #48
Comments
iirc you literally can't disable interlocking without editing the C source of emacs. this is a very strange issue that I've never experienced. emacs should not be hanging around with recentf open and modified. this is something we should dig into if it's happening with any regularity. |
If you set |
But Emacs should not be hanging around with recentf open and modified, and yet it is. |
Oh nice. That's literally a new feature since I last looked into it. |
I can't reproduce the issue. Maybe check the permissions on the recentf file? |
The code in |
Additionally, when it's loaded, it's literally just a call to |
Have you tried changing networks? That's what causes the problem for me—I've isolated the rest of the variables behind this.
Try changing networks and editing files for more than 5 minutes. Since |
Also, I might just go ahead and PR turning off lockfiles. |
I do most of those things relatively frequently and I'm pretty sure I would have run into the issue. At this point I can't even get a I would just recommend that next time you see this issue, check to see when the lockfile was created and if recentf is open in a buffer on your machine. That may help us narrow it down. If you want lockfiles off I would do it in your personal config for now. They do have a purupose. |
To answer your question, yes, the lockfile is created 5 minutes after the previous recentf save, and yes, recentf is open in a buffer when this condition takes place. |
I will try and look at this issue on a MacOS machine on Monday but if I rail to reproduce it I have no plan for proceeding with it. |
I can't reproduce in any capacity. I'm closing unless we get more information that would allow us to proceed. |
When you change networks, does your hostname change? |
I reopened this for tracking purposes. We might want to just disable interlocking via setting |
I will try and reproduce it again this morning when I head over to work. |
Hm. I was unable to reproduce this again reliably. If we're shying away from setting |
I didn't check to see if my hostmane changed. However, I couldn't get recentf to create a lockfile without manually opening the recentf file and modifying it by hand. Even then, |
Okay. Then I think it's safe to close this issue now. |
Randomly was able to reproduce this issue today. Investigating. |
syl20bnr/spacemacs#5186 looks related. No resolution there, however. |
Nope, pretty sure this is unrelated on more investigation. Somehow the save leaves the lock open but doesn't error? |
Check out this comment; it's not an elegant solution but one could patch over the |
I would be fine with advising |
Agreed, this all sounds good. |
The issue occurs when multiple instances of emacs are running. To solve this, we could adjust the time at which recentf saves to be dependent on the PID or something, instead of having all processes try to save exactly every 5 minutes and then conflicting with each other. |
So, this still happens and it seems increasingly clear that multiple emacs processes will of course all try and write the recentf file at the same time, and that obviously doesn't work. Of course, if you have multiple emacs processes open, there isn't really any way to sync recentf across these different files, so they are going to ultimately end up overwriting each other's changes. I propose simply modifying the |
@rye if this seems fine, I can take it. |
Thanks for taking the initiative and looking further into this. I like your proposed solution a lot. Go on ahead if you want. |
In my daily life, I walk around a lot. Emacs opens recentf a bunch, but it seems like it never really writes it to disk. (Evidenced by the fact that
#recentf#
is always left over in~/.emacs.d
except when the 5-minute#'recentf-save-list
timer gets run.)This is bad, because Emacs has support for preventing simultaneous edits, and when I change networks my hostname changes. Emacs then blocks my workflow and asks me if I want to steal the lock from myself. This is highly frustrating.
So, should we: (a) disable interlocking support entirely, via setting
create-lockfiles
tonil
globally, or (b) do something more intelligent? I'm going to leave this to @cg505 because I have never usedrecentf
before.The text was updated successfully, but these errors were encountered: