When the jenkinsfile is obtained from SCM using lightweight checkout, it always executes with maximum durability. (Note: the console output shows the value from the config, not the reality.)
Minimal pipeline script to reproduce:
If we check "Do not allow the pipeline to resume if the master restarts" then we expect no serialization to occur and the script to succeed. However, it fails with a NotSerializableException.
Note that the same snippet works properly in three other cases:
- non-lightweight checkout
- script inline on config page, without SCM
The problem seems to be in CpsScmFlowDefinition, where on line 121 the condition checks if the executable is an Item, but it is in fact a WorkflowRun. The condition should probably be more like the one below, on line 188.