-
Bug
-
Resolution: Not A Defect
-
Critical
-
None
-
2.44 version of email-ext-plugin
jenkins 2.1
I have putted the below line into groovy template:
<%
if (build.result.toString() == 'FAILURE'){
def lastSuccBuild = build.getPreviousSuccessfulBuild()
def nextBuild = null
def printedLast = false
if (null != lastSuccBuild && lastSuccBuild ){
nextBuild = build.getPreviousBuild()
while( nextBuild != null && nextBuild != lastSuccBuild){
changeSet = nextBuild.changeSet
if(changeSet != null &&changeSet.size() > 0) {
hadChanges = false
count = 0 %>
<TABLE width="100%">
<TR><TD class="bu3" colspan="2"><B>${nextBuild.number}. CHANGES</B></TD></TR>
<%
changeSet.each() { cs ->
hadChanges = true
count ++ %>
<TR>
<TD colspan="2" class="bu2">${count}. Revision <B><%= cs.metaClass.hasProperty('commitId') ? cs.commitId : cs.metaClass.hasP
roperty('revision') ? cs.revision :
cs.metaClass.hasProperty('changeNumber') ? cs.changeNumber : "" %></B> by
<B><%= cs.author %> (<a href="${rooturl}${build.url}changes#detail${count}">detail</a>)</B>
</TD>
</TR>
<TR><TD class="bu2" colspan="2"><B>${cs.msgAnnotated}</B></TD></TR>
<TR><TD colspan="2"> </TD></TR>
<% }
nextBuild = nextBuild.getPreviousBuild()
%>
</TABLE>
<BR/>
<%
}
}
}
}
the code "&& changeSet.size() > 0" made the build executor cannot be released!
with the " && changeSet.size() > 0", the console log blocked as last lines are
"Email was triggered for: Always
Sending email for trigger: Always".
Then, there are two executor are assigned on the node, I started another job, the later job blocked at the same point, then , the two job occupied the node, and will not release the executor until restart jenkins service.
But ,if remove the code "&& changeSet.size() > 0" , there will no blocking.
This is not a defect in email-ext, it would be in your SCM that returns the changeset.