The recent optimization to avoid processing pipelines if no events are waiting did not account for semaphores which may be held by jobs in different pipelines. In that case, a job completing in one pipeline needs to generate an event in another pipeline in order to prompt it to begin processing. We have no easy way of knowing which pipelines may have jobs which are waiting for a semaphore, so this change broadcasts an event to every pipeline in the tenant when a semaphore is released. Hopefully this shouldn't generate that much more traffic (how much depends on how frequently semaphores are released). If desired, we can further optimize this by storing semaphore pipeline waiters in ZK in a later change. Change-Id: Ide381279b0442d11535c00746e4baf19f32f3cd7
66 lines
1.1 KiB
YAML
66 lines
1.1 KiB
YAML
- pipeline:
|
|
name: check
|
|
manager: independent
|
|
trigger:
|
|
gerrit:
|
|
- event: patchset-created
|
|
success:
|
|
gerrit:
|
|
Verified: 1
|
|
failure:
|
|
gerrit:
|
|
Verified: -1
|
|
|
|
- pipeline:
|
|
name: gate
|
|
manager: dependent
|
|
success-message: Build succeeded (gate).
|
|
trigger:
|
|
gerrit:
|
|
- event: comment-added
|
|
approval:
|
|
- Approved: 1
|
|
success:
|
|
gerrit:
|
|
Verified: 2
|
|
submit: true
|
|
failure:
|
|
gerrit:
|
|
Verified: -2
|
|
start:
|
|
gerrit:
|
|
Verified: 0
|
|
precedence: high
|
|
|
|
- job:
|
|
name: base
|
|
parent: null
|
|
run: playbooks/base.yaml
|
|
nodeset:
|
|
nodes:
|
|
- label: ubuntu-xenial
|
|
name: controller
|
|
|
|
- semaphore:
|
|
name: test-semaphore
|
|
max: 1
|
|
|
|
- job:
|
|
name: check-job
|
|
run: playbooks/check.yaml
|
|
semaphores: test-semaphore
|
|
|
|
- job:
|
|
name: gate-job
|
|
run: playbooks/gate.yaml
|
|
semaphores: test-semaphore
|
|
|
|
- project:
|
|
name: org/project
|
|
check:
|
|
jobs:
|
|
- check-job
|
|
gate:
|
|
jobs:
|
|
- gate-job
|