diff options
author | Martin Poirier <theeth@yahoo.com> | 2011-07-25 01:25:05 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2011-07-25 01:25:05 +0400 |
commit | 273df5e7bf5bb2845332a79ebc52a0820a4b1fd1 (patch) | |
tree | 72efd0c52e49ae408a5131e552f4fc0e188bfc63 /netrender/master.py | |
parent | 925f9bfe6f03474a58bdb5b20d0aafffc9504b6a (diff) |
[#27796] Netrendering "path:" failing
by Wintch Analyzer
moving master working path initialization before connection creation
also added error checks and prints to debug an invalid internal state (related to another tracker entry)
Diffstat (limited to 'netrender/master.py')
-rw-r--r-- | netrender/master.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/netrender/master.py b/netrender/master.py index 0e406bc0..91e610ea 100644 --- a/netrender/master.py +++ b/netrender/master.py @@ -61,7 +61,11 @@ class MRenderSlave(netrender.model.RenderSlave): self.last_seen = time.time() def finishedFrame(self, frame_number): - self.job_frames.remove(frame_number) + try: + self.job_frames.remove(frame_number) + except ValueError as e: + print("Internal error: Frame %i not in job frames list" % frame_number) + print(self.job_frames) if not self.job_frames: self.job = None @@ -849,7 +853,6 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): class RenderMasterServer(socketserver.ThreadingMixIn, http.server.HTTPServer): def __init__(self, address, handler_class, path, subdir=True): - super().__init__(address, handler_class) self.jobs = [] self.jobs_map = {} self.slaves = [] @@ -861,6 +864,9 @@ class RenderMasterServer(socketserver.ThreadingMixIn, http.server.HTTPServer): else: self.path = path + if not os.path.exists(self.path): + os.mkdir(self.path) + self.slave_timeout = 5 # 5 mins: need a parameter for that self.balancer = netrender.balancing.Balancer() @@ -871,8 +877,7 @@ class RenderMasterServer(socketserver.ThreadingMixIn, http.server.HTTPServer): self.balancer.addPriority(netrender.balancing.NewJobPriority()) self.balancer.addPriority(netrender.balancing.MinimumTimeBetweenDispatchPriority(limit = 2)) - if not os.path.exists(self.path): - os.mkdir(self.path) + super().__init__(address, handler_class) def restore(self, jobs, slaves, balancer = None): self.jobs = jobs |