-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Check for stale lock files #2139
Conversation
1cd9e9b
to
9af78b1
Compare
The big question would have to be, does this work on Windows, too? |
Good point. I believe it would, but obviously what's needed is real testing. I'll take it for a spin on a Windows VM (which presumably will also involve installing KSP). |
I'm about to do so. You don't need a whole KSP, just the BuildID.txt and a GameData folder |
Seems to work fine on Windows, though it's much harder to get a real registry.locked file there. |
Yeah, wow, killing it with taskmgr cleans up the file, and it wouldn't even let me make a copy first. I'm vaguely curious as to how you managed it. |
A good setup for testing is a buildID.txt, a readme.txt, GameData and Ships directories. buildID.txt just needs a valid build ID like so:
(That's 1.3.0) readme.txt is not needed other than to check the failover for bad buildIDs, and should have:
(obviously, it's best to make the two files match as far as the version) I just created a dummy registry.locked file with a four digit number (almost guaranteed not to exist) |
This code change checks whether the registry lock file is stale before attempting to acquire the lock. This eliminates the lock file popup when it's not needed as per #2075, but keeps it when CKAN is actually still running.
I think there are race conditions if the user tries to start multiple copies of CKAN simultaneously; do we care about that?
Fixes #2075.