Skip to content

Commit

Permalink
fixup documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Clucas <[email protected]>
  • Loading branch information
Joibel committed Jul 18, 2024
1 parent 3070c90 commit 09a3526
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/synchronization.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ spec:

Examples:

1. [Workflow level semaphore](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-wf-level.yamlxb)
1. [Workflow level semaphore](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-wf-level.yaml)
1. [Workflow level mutex](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
1. [Step level semaphore](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-tmpl-level.yaml)
1. [Step level mutex](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)
Expand All @@ -169,14 +169,19 @@ synchronization:

The workflow will block until all of these mutexes and semaphores are available.

### Priority
### Queuing

When a Workflow cannot take a mutex or semaphore it will be placed into a ordered queue.

Workflows can have a `priority` set in their specification.
Workflows with a higher priority value will be queued to take a semaphore or mutex before a lower priority workflow, even if they have been waiting for less time.
The queue is first ordered by priority, with a higher priority number being placed before a lower priority number.
The queue is then ordered by `CreationTimestamp` of the Workflow; older Workflows will be ordered before newer workflows.

Workflows are only be allowed to take a mutex or semaphore if they are at the front of the queue for that mutex or semaphore.

!!! Warning
A high priority workflow waiting on multiple mutexes or semaphore will make all other workflows which want to acquire those mutexes wait for it to acquire and release all the mutexes or semaphores it is waiting on.
This applies even if the lower priority workflows only wish to acquire a subset of those mutexes or semaphores.
A Workflow at the front of the queue waiting on multiple mutexes or semaphore will make all other Workflows which want to acquire those mutexes wait for it to acquire and release all the mutexes or semaphores it is waiting on.
This applies even if the other Workflows only wish to acquire a subset of those mutexes or semaphores.

### Legacy

Expand Down

0 comments on commit 09a3526

Please sign in to comment.