
This is a multi-part message in MIME format... ------------=_1515912445-32493-213 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit [ https://ovirt-jira.atlassian.net/browse/OVIRT-1845?page=com.atlassian.jira.p... ] Barak Korren updated OVIRT-1845: -------------------------------- Assignee: Barak Korren (was: infra) Status: In Progress (was: To Do)
Removing build jobs makes change-queue fail with an exception --------------------------------------------------------------
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
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 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) {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) { 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 } } {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.
-- This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100075) ------------=_1515912445-32493-213 Content-Type: text/html; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 7bit <html><body> <pre>[ https://ovirt-jira.atlassian.net/browse/OVIRT-1845?page=com.atlassian.jira.p... ]</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-2BJ33BSM3t..." 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> ------------=_1515912445-32493-213--