What is pipeline durability and what are the three durability hints?
AdvancedConceptScripted pipeline, Groovy & CPS
Answer
Durability controls how often the pipeline state is written to disk.
| Hint | Behaviour |
|---|---|
MAX_SURVIVABILITY |
Writes after every step; safest, most disk I/O |
SURVIVABLE_NONATOMIC |
Writes every step but non-atomically |
PERFORMANCE_OPTIMIZED |
Writes only at certain points; much less I/O, but a crash can lose the running build |
Set per pipeline with options { durabilityHint('PERFORMANCE_OPTIMIZED') } or globally. We use performance-optimized for most CI pipelines (rerun is cheap) and max survivability for long release pipelines.
More on Scripted pipeline, Groovy & CPS
What does a scripted pipeline look like and when would you still write one?IntermediateWhat is CPS and why does Jenkins transform pipeline Groovy?AdvancedWhy does `java.io.NotSerializableException` happen in pipelines?AdvancedWhat does `@NonCPS` do and what are its rules?AdvancedWhy do some Groovy closures behave unexpectedly in pipelines, for example `list.each { }` or `sort`?AdvancedWhat is the `script` block in declarative, and what are its limits?Beginner