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

Avoid race conditions when the same policy is being pulled #5

Open
flavio opened this issue May 14, 2021 · 0 comments
Open

Avoid race conditions when the same policy is being pulled #5

flavio opened this issue May 14, 2021 · 0 comments

Comments

@flavio
Copy link
Member

flavio commented May 14, 2021

Pulling the same policy from different processes (eg: policy-server instances writing to the same directory, multiple instances of kwctl,...) can result in race conditions.

We should create a file lock inside of the policy store to ensure that:

  • Given N processes that want to download registry://foo.bar/policy:1.2,
  • Only one process downloads the policy to disk, all the other processes print a Waiting message and then proceed with their operation

We basically have to do something like cargo build does when invoked inside of the same directory by multiple processes at the same time.

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

1 participant