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

Have a lock mechanism for sto file writes #10768

Open
alexgarel opened this issue Sep 4, 2024 · 0 comments
Open

Have a lock mechanism for sto file writes #10768

alexgarel opened this issue Sep 4, 2024 · 0 comments

Comments

@alexgarel
Copy link
Member

What

We currently have a lock mechanism only at the store point for sto files.

But we can have concurrent requests (the mobile app is very atomic) which introduces inconsistencies.

We could have a lock mechanism to avoid concurrent writes to the sto file.

Redis has good primitives to support that in multi-process situations. https://github.com/sbertrang/redis-distlock might be an interesting implementation.

Early in the process of product edition we could acquire the lock product using it's id (eventually waiting). We can fail in case we can't get the lock. Lock should timeout after a small amount of time (case of killed worker), maybe 5s. In case we are stuck for too long, we can decide to fail (mobile app will retry the edit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To discuss and validate
Development

No branches or pull requests

1 participant