When working with AWS CodePipeline, it's important to understand how it handles multiple executions of the same pipeline. Let's break down the three execution modes with real-world examples to make them easier to understand.
π§ What Are Execution Modes?
Execution modes determine how CodePipeline handles a new execution when a previous one is still in progress.
There are three modes:
- Queued
- Superseded
- Parallel
1οΈβ£ Queued Execution Mode
π Behavior:
If the pipeline is already running and a new revision (commit) is detected, CodePipeline queues the new execution and waits for the current one to finish.
π¦ Example:
- You commit v1 β Pipeline starts running
- While v1 is deploying, you commit v2
- v2 waits until v1 finishes
- After v1 completes, v2 starts executing
π§ͺ Use Case: You want every revision to go through the full pipeline without skipping anything.
2οΈβ£ Superseded Execution Mode
π Behavior:
If a new revision comes in while another is still running, the current (older) one is stopped, and only the latest revision is executed.
π¦ Example:
- You commit v1 β Pipeline starts running
- You quickly commit v2 and v3
- v1 and v2 are canceled
- Only v3 is executed
π§ͺ Use Case: You only care about deploying the latest change, not every single revision.
3οΈβ£ Parallel Execution Mode
π Behavior:
CodePipeline starts multiple executions at the same time, even if others are still running.
π¦ Example:
- You commit v1, v2, and v3 quickly
- All 3 versions go through the pipeline simultaneously
π§ͺ Use Case: Youβre running long-lived testing or deployments for each commit in isolation.
π Summary Table
Mode | Older Execution Canceled? | New Execution Starts Immediately? | Use Case |
---|---|---|---|
Queued | β No | β³ After current finishes | Ensure every commit is tested |
Superseded | β Yes | β Immediately | Always deploy latest only |
Parallel | β No | β Yes | Run every commit in parallel |
βοΈ How to Configure Execution Mode?
You can configure this when you define the source action in CodePipeline using GitHub, CodeCommit, or S3.
For example, in AWS Console:
- Navigate to your pipeline
- Edit the Source stage
- Choose Change detection options
- Set behavior: Queued, Superseded, or Parallel
π Conclusion
Understanding how pipeline executions are handled helps you choose the best strategy for:
- Faster deployments (Superseded)
- Reliable testing (Queued)
- High-throughput testing (Parallel)
Let me know in the comments how you handle CI/CD concurrency in your pipelines!
Top comments (0)