Support concurrency policy across actions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
Tim on slack:
Hey all, I have a question regarding the concurrency policy implementation. I have a situation where 2 actions within the same pack both have the potential to run during the same time and in the course of their operation could both modify the same remove resource. The remote system has some db issues, for example it is unable to handle an INSERT for a duplicate key. I would like to enforce a concurrency policy between these 2 actions, so they don’t execute at the same time, however the current implementation appears to only enforce concurrency w.r.t to instances of the same action (using PolicyDB.resource_ref). Perhaps this could be accomplished by allowing resource_ref to be a list of actions, or treated as a regular expression? Anyone dealt with a similar issue?
I've considered a separate locking mechanism and that’s probably the direction I’ll go in. We’re making heavy use of st2 policies and mistral workflows, so wanted to make sure I was not missing something that could be utilized within the existing framework.
Also curious if it’s a general problem that would be a natural extension of policies.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the existing concurrency policy implementation and PolicyDB.resource_ref, the only entry point named. Clarify whether cross-action locking belongs in policies or a separate mechanism; the issue does not define an implementation scope or tests, so done requires an agreed behavior for two actions in one pack contending for the same resource.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100