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

Add file lock to support mutli processes usage #614

Closed
wants to merge 2 commits into from

Conversation

jnhyperion
Copy link

Using filelock can ultimately solve the process safe problem without specifying any os env variables.

Also, this does not conflict with WDM_LOCAL or pytest-xdist support.

@stuaxo
Copy link

stuaxo commented Sep 15, 2023

Are there circumstances (e.g. a reboot) where the lock could be there after the app is terminated in an unexpected way?

I wonder if an option to delete an already present lock is needed ?

@jnhyperion
Copy link
Author

jnhyperion commented Sep 16, 2023

No, in my understanding, the lock is in OS io level, it does not matter with the .lock file exists or not.

When a process holds a file lock and it's killed somehow, the OS io level lock will be automatically released, it will not impact the next lock acquire.

@SergeyPirogov
Copy link
Owner

It will not work. The multiprocess issue happen because several processes tries to write into in file/folder

@jnhyperion
Copy link
Author

@SergeyPirogov I don't understand why you're saying it will not work. Library filelock aims to solve the problem exactly you described "several processes tries to write into in file/folder".

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.

3 participants