提交 7d5e4003 编写于 作者: D Devin Nusbaum

[JENKINS-57805] Guard against exceptions thrown by implementations of Queue.Task.getAffinityKey

上级 892bdf12
......@@ -112,7 +112,14 @@ public abstract class LoadBalancer implements ExtensionPoint {
private boolean assignGreedily(Mapping m, Task task, List<ConsistentHash<ExecutorChunk>> hashes, int i) {
if (i==hashes.size()) return true; // fully assigned
String key = task.getAffinityKey() + (i>0 ? String.valueOf(i) : "");
String key;
try {
key = task.getAffinityKey();
} catch (RuntimeException e) {
// Default implementation of Queue.Task.getAffinityKey, we assume it doesn't fail.
key = task.getFullDisplayName();
}
key += i > 0 ? String.valueOf(i) : "";
for (ExecutorChunk ec : hashes.get(i).list(key)) {
// let's attempt this assignment
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册