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

Enable removal of UNIX lock files #408

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sbc100
Copy link

@sbc100 sbc100 commented Apr 2, 2025

This avoids leaving orphan locks files around after we are done when them.

See emscripten-core/emscripten#24035

Fixes: #31

This avoids leaving orphan locks files around after we are done when
them.

See emscripten-core/emscripten#24035

Fixes: tox-dev#31
Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

Please add tests 👍

@sbc100
Copy link
Author

sbc100 commented Apr 2, 2025

Please add tests 👍

I can add a test that confirm the that lock file is deleted.

Added a test the races mentioned do not pose a problem is harder. Even if we added some intense stress tests that right conditions for the race might not happen.

Hopefully the former is enough?

sbc100 added a commit to emscripten-core/emscripten that referenced this pull request Apr 2, 2025
See tox-dev/filelock#31 and
https://stackoverflow.com/a/51070775.

Without this change the `cache/symbol_lists` directory ends up full of
many lock files that might never get cleaned up (At least since #24029
landed).

I'm also sending this change upstream:
tox-dev/filelock#408
@sbc100 sbc100 force-pushed the remove_lockfile branch from f659f70 to 54f3adf Compare April 2, 2025 18:35
open_flags = os.O_RDWR | os.O_TRUNC
if not Path(self.lock_file).exists():
open_flags |= os.O_CREAT
open_flags = os.O_RDWR | os.O_TRUNC | os.O_CREAT
Copy link
Author

Choose a reason for hiding this comment

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

I worry a little that I had to remove this workaround which was added in: #317.

I can't seem to find a way to keep both of these fixes in place.

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.

Random assertions failing in test.py
2 participants