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

Does InterProcessLock work with S3/Remote filesystem #113

Open
BrandonLiang opened this issue May 24, 2024 · 3 comments
Open

Does InterProcessLock work with S3/Remote filesystem #113

BrandonLiang opened this issue May 24, 2024 · 3 comments

Comments

@BrandonLiang
Copy link

BrandonLiang commented May 24, 2024

e.g. (from https://pypi.org/project/fasteners/)

lock = fasteners.InterProcessLock('s3://my-bucket/path/to/lock.file') 

Use case: I have an integration test that modifies my S3 bucket (I have teardown setup). I want this integration test to run both locally and in CI/CD, so I want to use a lock to prevent race conditions but the filesystem is different between local and CI/CD.

@BrandonLiang
Copy link
Author

I could not find a good existing solution, so created this PR: #114

@psarka
Copy link
Collaborator

psarka commented May 28, 2024

Thanks Brandon!

It is much more difficult to implement the S3 support. I would like it to be a separate class, use generic methods to authenticate and to be covered by an extensive test suite.

Also, I'm surprised that this approach works, did you try this from two different machines? Does it really lock?

@BrandonLiang
Copy link
Author

yes that approach makes sense. Feel free to refactor or close #114 for now

I haven't tested yet but will do shortly. I don't see any reason why it couldn't but will keep you posted

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

No branches or pull requests

2 participants