Skip to content
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

Lockfiles not removed in several scenarios #31

Closed
diovudau opened this issue Jul 2, 2020 · 0 comments
Closed

Lockfiles not removed in several scenarios #31

diovudau opened this issue Jul 2, 2020 · 0 comments
Assignees

Comments

@diovudau
Copy link
Contributor

diovudau commented Jul 2, 2020

Transferred from https://github.com/original-male/non/issues/270

If you load a session a .lock file gets created. If you close with /nsm/server/close the lockfile gets deleted. It also works with abort and with creating a new session.

However, if you choose to open a new session with /nsm/server/open the current sessions lockfile remains. Even when the new sessions gets closed, the first lockfile remains.

The lockfile also remains if you duplicate the current session, which closes the current one.

I believe in the case of duplication and switching this is a bug and the lockfile should be deleted.

If you create a new session, which NSM automatically opens, no lockfile gets created.

Legacy-GUI: even with a lockfile present, the session will still open. There are no relevant tests for the lockfile.
It is very rare that I see the popup-dialog that a session is already locked. In fact I can't remember I have ever seen it except someone opened two non-session-manager GUIs by accident. Otherwise these are false-positives: If the files are write-protected or ( nsmd.cpp load_session_file() ) if session's folder doesn't exists, it answers "/error ERR_SESSION_LOCKED session is locked by another process.".

See also this PR where I discuss if lockfiles should be removed completely
#30

It is also possible to move the lockfiles out of the session dir and into a temporary directory that will get cleaned up by the OS. Then a real computer crash (no electricity) will not lock a session over a reboot.

A fixed and known outside location could also be used for server lookup. The lockfiles could contain NSM Urls so that external programs, scripts and launchers can look up if a session is currently running and under which OSC-URL.

@diovudau diovudau self-assigned this Mar 5, 2022
diovudau pushed a commit that referenced this issue Mar 5, 2022
…. Repair and extend lockfiles as well. fixes #gh-31
@diovudau diovudau closed this as completed Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant