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

Synchronization (Lock) #5823

Open
milenvk opened this issue Dec 1, 2022 · 3 comments
Open

Synchronization (Lock) #5823

milenvk opened this issue Dec 1, 2022 · 3 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@milenvk
Copy link

milenvk commented Dec 1, 2022

Feature request

The ability to coordinate and synchronize access to a shared resource between concurrently running tasks and pipelines.

Use case

Two or more tasks that run in parallel (either in the same pipeline run or on concurrently running pipeline runs) need to modify a shared resource. For example two task runs, executed in parallel, need to bump up a build number stored in a git repository. Both tasks need to fetch the current version number, increment it by 1, and then push the new version number. To avoid conflicts, the task runs try to acquire a cluster-level lock with a unique name, (say called "version-update"). The task run that manages to acquire the lock first, holds it until it finishes its work, and then releases it. The task run that failed to acquire the lock waits for the lock to be released, and then it acquires it, and does its work. No conflicts.

Comments

This could be manually implemented as part of each task (by say using leader election https://pkg.go.dev/k8s.io/client-go/tools/leaderelection), however the user needs to account for releasing the lock in case a task run failed or timed out.
Having a lock, or general synchronization as part of the Task CRD (see reference below), complete with a lock lifecycle management, would make things easier for the user.

References

For an implementation of a similar feature please see Argo Workflows Synchronization: https://argoproj.github.io/argo-workflows/synchronization/

@milenvk milenvk added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 1, 2022
@milenvk milenvk changed the title Lock Synchronization (Lock) Dec 1, 2022
@jerop
Copy link
Member

jerop commented Dec 13, 2022

Related to #2828 -- cc @wlynch

@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 13, 2023
@jerop
Copy link
Member

jerop commented Mar 13, 2023

/lifecycle frozen

@tekton-robot tekton-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
Status: Todo
Development

No branches or pull requests

3 participants