-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not unregister completed executions when iterating over FlowExecutionList
to avoid unnecessary log warnings
#304
Do not unregister completed executions when iterating over FlowExecutionList
to avoid unnecessary log warnings
#304
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea seems right, but we want to keep the unregister
call from
workflow-api-plugin/src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java
Lines 198 to 213 in 4521fef
/** | |
* When Jenkins starts up and everything is loaded, be sure to proactively resurrect | |
* all the ongoing {@link FlowExecution}s so that they start running again. | |
*/ | |
@Extension | |
public static class ItemListenerImpl extends ItemListener { | |
@Override | |
public void onLoaded() { | |
FlowExecutionList list = FlowExecutionList.get(); | |
for (final FlowExecution e : list) { | |
// The call to FlowExecutionOwner.get in the implementation of iterator() is sufficent to load the Pipeline. | |
LOGGER.log(Level.FINE, "Eagerly loaded {0}", e); | |
} | |
list.resumptionComplete = true; | |
} | |
} |
src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java
Outdated
Show resolved
Hide resolved
src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java
Show resolved
Hide resolved
…d complete FlowExecutions.
src/main/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionList.java
Outdated
Show resolved
Hide resolved
@dwnusbaum can you help with review/merge of this fix? Currently holds up another series of PRs (e.g. jenkinsci/kubernetes-plugin#1342) |
@Vlatombe Sure I will look at this today |
@Vlatombe Did you check this against tests in |
@dwnusbaum no. To cover the new lines would require a test pipeline involving a cloud agent (so that the agent gets removed at the end of the |
It should be possible to set up a relevant test with |
computeNext()
should not cause a side-effect in the normal caseFlowExecutionList
to avoid unnecessary log warnings
cf. jenkinsci/kubernetes-plugin#1342 (comment)
Testing done
AFAIU to reproduce the issue would require to set up a cloud agent. On its termination, it calls indirectly
computeNext()
which unregisters theFlowExecutionOwner
if it is the last node in the pipeline. Then the regularunregister
call when theWorkflowRun
completes now issues a warning because it has already been unregistered.Submitter checklist