Commit d66de8fd authored by Paul Rich's avatar Paul Rich
Browse files

All forkers will no longer be incremented. Proper forker selected.

I don't even know how I missed this in preliminary testing.  The forker
increment is now fixed when using multiple forkers.  Additionally, the
first forker in the list was always getting used regardless of status,
which kind of defeats the entire point of this patch.
parent c3cce338
......@@ -117,15 +117,18 @@ class ProcessGroupManager(object): #degenerate with ProcessMonitor.
'''
selected_forker = None
ordered_forkers = [f[0] for f in sorted(self.forker_taskcounts.items(), key=lambda x:x[1])]
ordered_forkers = [f[0] for f in sorted(self.forker_taskcounts.items(), key=lambda x: x[1])]
if len(ordered_forkers) < 0:
raise RuntimeError("Job %s: No forkers registered!", jobid)
else:
count = 0
for forker in ordered_forkers:
if self.forker_reachable[forker]:
selected_forker = ordered_forkers[0] #this is now a tuple
selected_forker = ordered_forkers[count]
self.forker_taskcounts[selected_forker] += 1
_logger.info("Job %s using forker %s", jobid, selected_forker)
break
count += 1
if selected_forker is None:
# We didn't find a forker, raise a RuntimeError for this
raise RuntimeError("Job %s: No valid forkers found!" % jobid)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment