[JIRA] (JENKINS-57913) Make errors thrown by CpsFlowExecution.getNode halt Pipeline execution

1 view
Skip to first unread message

dnusbaum@cloudbees.com (JIRA)

unread,
Jun 7, 2019, 10:12:03 AM6/7/19
to jenkinsc...@googlegroups.com
Devin Nusbaum created an issue
 
Jenkins / Improvement JENKINS-57913
Make errors thrown by CpsFlowExecution.getNode halt Pipeline execution
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: workflow-cps-plugin
Created: 2019-06-07 14:11
Labels: pipeline robustness
Priority: Minor Minor
Reporter: Devin Nusbaum

Spun out of JENKINS-57805 as a separate improvement.

Because Pipeline lazily loads flow nodes as they are needed after a Jenkins restart, almost any caller of methods that end up traversing the flow graph and calling CpsFlowExecution.getNode may end up receiving an IOException due to an invalid FlowNode. Even if that caller is able to handle the error, the flow graph may be left in a corrupted state for other callers (i.e. if FlowNode.loadParents fails, we may have a node in the middle of the flow with no parents). Once the flow graph is corrupted, other callers may run into further issues when they manipulate/traverse the graph, especially because they might not see the original exception and will instead see corrupt/invalid data without necessarily realizing it.

To avoid further issues, it seems safer to try to halt Pipeline execution when CpsFlowExecution.getNode throws an Exception to avoid compounding issues. Whether this can be done safely and in a way that actually improves the situation is not immediately obvious to me, and it would take some experimentation.

A test case that can be adapted to reproduce this kind of problem can be found in https://github.com/jenkinsci/workflow-api-plugin/pull/94.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages