Skip to content

Use a specific lock file to avoid temp directory contention #13371

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

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 29, 2021

Previously in debug mode we could try to avoid temp file contension by
taking and holding the cache lock for the duration of the process.

This change uses a specific lock file within the temp directory which
avoids needing a writable cache directory. Its also more logical.

Partial fix for #13369

@sbc100 sbc100 requested a review from kripken January 29, 2021 00:20
@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 29, 2021

This change is needed in order to unblock the emsdk bump (current blocked on bazel and #13369)

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % comments

If it's urgent to land this we can defer the comments for later.

# In the case where we run emcc recurively to populate the cache we
# do still need to ignore this lock, in the same way we do for the cache
# lock.
if 'EM_EXCLUSIVE_CACHE_ACCESS' not in os.environ:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is a little unfortunate to mention EM_EXCLUSIVE_CACHE_ACCESS here as it would be the first time outside of cache.py. Perhaps we could call a helper function in that file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a little sad that need this exception here.. but I'm OK with hardcoding it for now. Hopefully in the long run we can completely remove EM_EXCLUSIVE_CACHE_ACCESS.

Previously in debug mode we could try to avoid temp file contension by
taking and holding the cache lock for the duration of the process.

This change uses a specific lock file within the temp directory which
avoid needing a writable cache directory. Its also more logical.

Partial fix for #13369
@sbc100 sbc100 merged commit a8d41c0 into master Jan 29, 2021
@sbc100 sbc100 deleted the avoid_cache_lock branch January 29, 2021 16:04
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.

2 participants