From 4d60ca0c3c2b9969373eeabdf7c38b1c79f0ac2d Mon Sep 17 00:00:00 2001 From: Stephen Mardson McQuay Date: Tue, 24 May 2011 13:46:07 -0600 Subject: [PATCH] some error detection: make sure the set of reported workers has no duplicate entries --- bin/master.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/master.py b/bin/master.py index 3a842b8..11e3557 100644 --- a/bin/master.py +++ b/bin/master.py @@ -59,12 +59,15 @@ if __name__ == '__main__': tasksq, resultsq, masterq, minionsq = get_qs(m) + workers = [] + if not options.participants: print "wait on all announced participants" participants = 0 while not masterq.empty(): participants += 1 worker = masterq.get() + workers.append(worker) print "%d: %s is ready" % (participants, worker) if participants == 0: print "nobody found" @@ -74,8 +77,14 @@ if __name__ == '__main__': print "wait on %d participants" % participants for i in xrange(participants): worker = masterq.get() + workers.append(worker) print "%d of %d: %s is ready" % (i+1, participants, worker) + if len(set(workers)) != len(workers): + for i in workers: + minionsq.put("slay") + raise Exception("duplicate workers reported") + results = [] widgets = ['submit jobs: ', Percentage(), ' ', Bar(), ' ', ETA()]