mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 05:52:26 +00:00
JENKINS-52159: Queue.maintain - tolerate misbehaving sorter.sortBuildableItems()
Any plugin that implements the sort step could throw an exception which would break
the maintain() step. As sorting is really an optional step, it really should not be fatal.
Instead, we wrap the step in a try block, log it, and move on with life.
(cherry picked from commit 1083a3f5c6)
This commit is contained in:
1 parent
b83f350d01
commit
e7bf396555
1 file changed
+9
-2
@@ -1569,8 +1569,15 @@ public class Queue extends ResourceController implements Saveable {
|
||||
}
|
||||
}
|
||||
|
||||
if (s != null)
|
||||
s.sortBuildableItems(buildables);
|
||||
if (s != null) {
|
||||
try {
|
||||
s.sortBuildableItems(buildables);
|
||||
} catch (Throwable e) {
|
||||
// We don't really care if the sort doesn't sort anything, we still should
|
||||
// continue to do our job. We'll complain about it and continue.
|
||||
LOGGER.log(Level.WARNING, "s.sortBuildableItems() threw Throwable: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure that identification of blocked tasks is using the live state: JENKINS-27708 & JENKINS-27871
|
||||
updateSnapshot();
|
||||
|
||||
Reference in new issue
Block a user