<html><body>
<pre>[ https://ovirt-jira.atlassian.net/browse/OVIRT-1845?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]</pre>
<h3>Barak Korren updated OVIRT-1845:</h3>
<pre>Assignee: Barak Korren (was: infra)
Status: In Progress (was: To Do)</pre>
<blockquote><h3>Removing build jobs makes change-queue fail with an exception</h3>
<pre> Key: OVIRT-1845
URL: https://ovirt-jira.atlassian.net/browse/OVIRT-1845
Project: oVirt - virtualization made easy
Issue Type: Bug
Components: Change Queue
Reporter: Barak Korren
Assignee: Barak Korren
Priority: Highest</pre>
<p>When changes are added to the change queue, it records the build jobs that build artifacts for changed code. If the build jobs are removed between the time the change is added to the queue and the time a tested jobs including that change is started, the code checking for completion of the build jobs would fail with an exception looking like the following: {code} java.lang.NullPointerException: Cannot invoke method getBuild() on null object</p>
<pre>at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at Script1$_all_builds_done_closure4.doCall(Script1.groovy:265)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)</pre>
<p>{code} ‘{{Script1}}’ in this stack trace refers to our ‘{{change-queue-tester.groovy}}’ script. Relevant code section is the following: {code} @NonCPS def all_builds_done(builds) {</p>
<pre> return !builds.any {
if(Jenkins.instance.getItem(it.job_name).getBuild(it.build_id).isBuilding()) {
print("${it.job_name} (${it.build_id}) still building")
return true
}
return false
}</pre>
<p>} {code} The issue it with not checking for ‘{{null}}’ return from the ‘{{Jenkins.instance.getItem(it.job_name)}}’ funcntion call. We should probably check for ‘{{null}}’ there and just ignore it. Similar check will probably be needed in other places in the code like for example when composing the ‘{{extra-sources}}’ file from the build job URLs.</p></blockquote>
<p>— This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100075)</p>
<img src="https://u4043402.ct.sendgrid.net/wf/open?upn=i5TMWGV99amJbNxJpSp2-2BJ33BSM3tuiUfRTk64K-2BOjGpF-2BuMzoJRRB1ifzZIErtIxTccLy521zz7OxZViB5mnpbbwYJFz6flgevXOzUJVH-2FqBqvcqqqKIp3p4OcyDFOsRwvaLk1r7X8JpLEbbYtQ-2F8se-2FAoG3NqMy6MEF960fM4WCfArIPipDAxV3I9QtDxwIZkeNWD9yApPsdJra3V4NT7hIOoTif46hN9A2Na-2BIseHngSSOzrSPo87Xs5dlTOpfId-2BM0nMQbjsVkor0gpq3xXBysjjuwGs5Lqq5bAkFNsZheFQoTxs155R0tV87JAGpDO9-2BQsLnmS6lSGfdkK9vN0nrRbvFLEP4xbKBS3sHCQ6EbyE-2BmgsCEtpwqS1CCAyIwnheHnNK3JiWvUNdf1C8AXWTH5a5HXo4wfWVocG84stqE4LVx8-2BMlEul-2BxZWvQs" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>