简体   繁体   English

如果标签离线,Jenkins Matrix Groovy执行策略插件将挂起

[英]Jenkins Matrix Groovy Execution Strategy Plugin hangs if label is offline

I am trying to implement a more complex combination filter for Jenkins using the Matrix Groovy Execution Strategy Plugin . 我正在尝试使用Matrix Groovy执行策略插件为Jenkins实现更复杂的组合过滤器。 See my previous question for more details. 有关更多详细信息,请参见我之前的问题 It seems to work otherwise but if the nodes where the label is set are offline, the matrix job hangs and does not put the rest of the matrix items into the job queue. 似乎可以正常工作,但是如果设置了标签的节点处于脱机状态,则矩阵作业将挂起,并且不会将其余矩阵项放入作业队列中。

This is enough Groovy to cause the same effect in the plugin: Groovy足以在插件中产生相同的效果:

combinations.each{
            result[it.cfg] = result[it.cfg] ?: []
            result[it.cfg] << it
}
return [result, true]

If I set the execution strategy to "Classic", all the job labels go into the queue even if some nodes are offline. 如果将执行策略设置为“经典”,则即使某些节点处于脱机状态,所有作业标签也会进入队列。 I have "Execute concurrent builds if necessary" enabled if that makes any difference. 如果有任何区别,我启用了“如有必要,执行并发构建”。

Is there some setting I need to fix or is this a plugin issue? 是否需要修正某些设置,或者这是插件问题?

Thats because the classic strategy puts all the keystone jobs in the queue and then the others afterwards. 那是因为经典策略将所有梯形工作排在队列中,然后将其他梯队排入队列。

This plugin will schedule them in sections and if the node is offline then they will wait, which is standard behaviour 此插件将按部分计划它们,如果节点处于脱机状态,则它们将等待,这是标准行为

you could try this 你可以试试这个

Note: I wrote the matrix execution strategy plugin 注意:我写了矩阵执行策略插件


Incorporated comments 合并评论

You can force all the combinations to submit in one go by doing the following: 您可以通过以下操作强制所有组合一次性提交:

combinations.each{
            result["a"] = result["a"] ?: []
            result["a"] << it
}
return [result, true]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM