From bd775698b95ce37eae11afca277d7bebbdff8966 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 26 Nov 2009 09:10:31 +0000 Subject: [PATCH] Merged revisions 24110-24112 via svnmerge from https://svn.dev.java.net/svn/hudson/branches/rc ........ r24110 | kohsuke | 2009-11-25 17:14:49 -0800 (Wed, 25 Nov 2009) | 22 lines On my production server I started seeing a strange NPE like this: java.lang.NullPointerException at hudson.model.Label.contains(Label.java:277) at hudson.model.Queue$JobOffer.canTake(Queue.java:177) at hudson.model.Queue$ApplicableJobOfferList.(Queue.java:767) at hudson.model.Queue$ApplicableJobOfferList.(Queue.java:759) at hudson.model.Queue.pop(Queue.java:684) at hudson.model.Executor.grabJob(Executor.java:161) at hudson.model.Executor.run(Executor.java:103) The only possibility is that the getNodes() is returning null, and that's only possible if Label.getNodes() returns null, which in turn is only possible if the assignment to nodes is overwritten by the reset method before it's used as a return value. This fix should eliminate the possibility that the getNodes() method return null. ........ r24111 | kohsuke | 2009-11-25 17:15:45 -0800 (Wed, 25 Nov 2009) | 2 lines Actually, getNodes() has another possibility of such a data race. ........ r24112 | kohsuke | 2009-11-25 17:24:27 -0800 (Wed, 25 Nov 2009) | 1 line typo ........ git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@24127 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Label.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/core/src/main/java/hudson/model/Label.java b/core/src/main/java/hudson/model/Label.java index 2cf0d8b284..c4a548cd2c 100644 --- a/core/src/main/java/hudson/model/Label.java +++ b/core/src/main/java/hudson/model/Label.java @@ -106,18 +106,18 @@ public class Label implements Comparable