-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Allow skipping a workflow if mutex cannot be acquired #13055
Comments
As semaphores and mutexes can be used at a finer grained level than a whole Workflow, I'd suggest the policy should be just called To implement #12757 (which is mine, so I do have an interest here) you'd need a It's somewhat preferable to implement this mechanism over #12757's proposal because it's more powerful. It's also much less intuitive for the simple case that that issue is aiming for and requires more typing. |
Yea, I was thinking about that, but as
Agree
We should use a different word to avoid negative connotations. |
+1 on the above definitely cleaner. Re:
do you think that warrants a separate ticket entirely? Or would it be something that could be added as part of the policy implementation? (e.g., for a lock to be held longer than the mere execution time of the workflow) |
Summary
If a mutex is at the workflow level, other workflows with the same mutex will wait till the mutex is acquired. However, there would be cases where we would want to skip a workflow entirely if another instance of the workflow has the mutex. This could be doable via some configuration option like the following:
We could expose different types of policies like
skipWorkflow
,wait
, etc.Use Cases
There are cases were a workflow runs to ingest / update some data set, for instance fetch new rows from a database for a given entity. Running two of the same workflows will have no meaning as they will fetch the exact same data, thus a mutex prevents this duplication, however currently it does not prevent duplicating work back-to-back without custom logic within the workflow executable. A policy that would determine what to do if a lock is not acquired would allow skipping the secondary (redundant) workflow entirely.
Beyond this issue, one could allow more complex blocking policies as well, where a mutex is considered to be "held" for longer periods of time than a workflow is running for. For instance, say I ingest data that get updated every 12h from some remote source. If a single one of the workflows has been run within that time window, we could force the mutex to be held for 12h, even if the workflow has been completed, so as no other workflows can run and do redundant work within that time period. This would be useful because, even if skipWorkflow is accepted as a feature request, one could schedule redundant workflows to be running one after the other without lock contention.
Message from the maintainers:
Love this feature request? Give it a 👍. We prioritise the proposals with the most 👍.
The text was updated successfully, but these errors were encountered: