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

Do not ensure write access when there are no CHs/LMs to prepare #2500

Merged
merged 1 commit into from
Dec 17, 2021

Conversation

easbar
Copy link
Member

@easbar easbar commented Dec 17, 2021

Fixes #2498.

I probably introduced this bug when I was working on #2481. When we call GraphHopper#load and preparations are only loaded so there is nothing else to prepare we need no write access. I therefore put back the ensureWriteAccess calls that we just removed to partially fix the bug in 674828b, but under the condition that there are actually things to prepare.

Closing the location index, names and way geometry storage is done unconditionally, because they aren't needed in any case (neither if there are CHs to prepare, nor if there are no CHs to prepare). We can even close the way geometry and names before the LM preparation (unless there are no custom profiles), which saves some memory if the import only includes LM.

@michaz, @oli0044 does this fix the problem you were running into? I still think we should also remove the setAllowWrites and lock file stuff, but I'd like to do this as a follow up and possibly at a later time if this PR fixes the actual bug for now. As a minimum requirement we should keep the lock file to prevent running two import commands simultaneously, see #2498 (comment).

@easbar easbar merged commit 1c7a0ed into master Dec 17, 2021
@easbar easbar deleted the dont_ensure_write_access branch December 17, 2021 07:21
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

Successfully merging this pull request may close these issues.

setAllowWrites(false) makes GraphHopper.load() fail even though no write access is needed.
1 participant