Tidied up and running pretty well.
Need to do the Options() initialization properly on the slave nodes to
check for binaries, modules, set up etc.

file:763d43f936e9db0cece0d07aa1c4347907ae8d00 -> file:46b76f0488027ee0622e3c03ea3872d873d71eaa
--- a/mp3togo/cluster.py
+++ b/mp3togo/cluster.py
@@ -254,10 +254,20 @@ class Boss:
self.wf.flush()
self.wf.write(EOT)
self.wf.flush()
+ errors = 0
while 1:
a, b, c = select.select([self.fd1, self.fd2], [], [], 60)
if a:
- inp = self.rf.read()
+ try:
+ inp = self.rf.read()
+ except IOError:
+ errors += 1
+ if errors > 25:
+ if self.current:
+ self.files.push(self.current, front=True)
+ raise StopIteration
+ yield ('Not Ready', 'Not Ready', 0)
+ continue
self.rf.flush()
for line in inp.split('\n'):
line = line.replace('\r', '')
@@ -273,9 +283,7 @@ class Boss:
or len(self.fails[self.current]) > MAXTRIES):
oldcurrent = self.current
try:
- print "recurse"
next()
- print "return"
finally:
self.files.push(oldcurrent, front=True)
return
@@ -346,6 +354,7 @@ def slavedriver(playlist, opts, cooked=N
slaves = opts['cluster']
slaves = slaves.split(',')
+ master = None
p("Connecting to cluster nodes:\n")
fails = {} # {'badfilename': [host,...]}
@@ -364,6 +373,8 @@ def slavedriver(playlist, opts, cooked=N
p("\n\n")
files = dict(map(lambda x: (x, ''), slaves))
+ if master:
+ files[master.host] = ''
while ring:
for slave in ring[:]:
try: