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

Check for stale lock files #2139

Merged
merged 1 commit into from
Oct 15, 2017
Merged

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Oct 14, 2017

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.

@Olympic1 Olympic1 added the Registry Issues affecting the registry label Oct 14, 2017
@politas
Copy link
Member

politas commented Oct 15, 2017

The big question would have to be, does this work on Windows, too?

@HebaruSan
Copy link
Member Author

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).

@politas
Copy link
Member

politas commented Oct 15, 2017

I'm about to do so. You don't need a whole KSP, just the BuildID.txt and a GameData folder

@politas
Copy link
Member

politas commented Oct 15, 2017

Seems to work fine on Windows, though it's much harder to get a real registry.locked file there.

@politas politas merged commit 9af78b1 into KSP-CKAN:master Oct 15, 2017
politas added a commit that referenced this pull request Oct 15, 2017
@HebaruSan
Copy link
Member Author

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.

@HebaruSan HebaruSan deleted the fix/lock-pid-check branch October 15, 2017 22:23
@politas
Copy link
Member

politas commented Oct 15, 2017

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:

build id = 01804

(That's 1.3.0)

readme.txt is not needed other than to check the failover for bad buildIDs, and should have:

Version 1.3.0

(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)

@HebaruSan HebaruSan changed the title Check for stale lock files (fixes #2075) Check for stale lock files Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Registry Issues affecting the registry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Locking pid validation fails
3 participants