From f3ffeee42a8e8bb9809943596277dc93c4a8cb53 Mon Sep 17 00:00:00 2001 From: Samuel M Smith Date: Wed, 3 Dec 2014 10:41:25 -0700 Subject: [PATCH 1/4] Fix ValueError message Reenable retries --- salt/transport/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/salt/transport/__init__.py b/salt/transport/__init__.py index 4dd04cdb1b..eff3957f9b 100644 --- a/salt/transport/__init__.py +++ b/salt/transport/__init__.py @@ -179,7 +179,13 @@ class RAETChannel(Channel): if time.time() - start > timeout: if tried >= tries: raise ValueError("Message send timed out after '{0} * {1}'" - " secs on route = {2}".format(tries, timeout, self.route)) + " secs. route = {2} track = {3} " + "load = {4}".format(tries, + timeout, + self.route, + track, + load)) + self.stack.transmit(msg, self.stack.nameRemotes['manor'].uid) tried += 1 time.sleep(0.01) return jobber_rxMsgs.pop(track).get('return', {}) From f99d94866d8a71fffd59b6f283390265f9348979 Mon Sep 17 00:00:00 2001 From: Samuel M Smith Date: Thu, 4 Dec 2014 10:10:04 -0700 Subject: [PATCH 2/4] fix up bugs --- salt/utils/raetlane.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/salt/utils/raetlane.py b/salt/utils/raetlane.py index 40193e364e..72cf7a98d4 100644 --- a/salt/utils/raetlane.py +++ b/salt/utils/raetlane.py @@ -66,7 +66,7 @@ from raet.lane.yarding import RemoteYard # Module globals for default shared LaneStack for a process. rx_msgs = {} # module global dict of deques one for each receipient of msgs lane_stack = None # module global that holds raet LaneStack -remote_yard = None # module global that holds raet +remote_yard = None # module global that holds raet remote Yard master_estate_name = None # module global of motivating master estate name master_yard_name = None # module global of motivating master yard name @@ -84,12 +84,11 @@ def prep(opts, ryn='manor'): if not lane_stack: _setup(opts=opts, ryn=ryn) - def _setup(opts, ryn='manor'): ''' Setup the LaneStack lane_stack and RemoteYard lane_remote_yard global ''' - global lane_stack, lane_remote_yard # pylint: disable=W0602 + global lane_stack, remote_yard # pylint: disable=W0602 role = opts.get('id') if not role: @@ -119,14 +118,15 @@ def _setup(opts, ryn='manor'): sockdirpath=opts['sock_dir']) lane_stack.Pk = raeting.packKinds.pack + log.debug("Created new LaneStack and local Yard named {0} at {1}\n".format( + lane_stack.name, lane_stack.ha)) remote_yard = RemoteYard(stack=lane_stack, name=ryn, lanename=lanename, dirpath=opts['sock_dir']) lane_stack.addRemote(remote_yard) - log.debug("Created new LaneStack and local Yard named {0} at {1}\n".format( - lane_stack.name, lane_stack.ha)) - + log.debug("Added to LaneStack {0} remote Yard named {1} at {2}\n".format( + lane_stack.name, remote_yard.name remote_yard.ha)) def transmit(msg): ''' @@ -134,18 +134,16 @@ def transmit(msg): ''' lane_stack.transmit(msg, remote_yard.uid) - def service(): ''' Service the lane_stack and move any received messages into their associated - deques in lane_rx_msgs keyed by the destination share in the msg route dict + deques in rx_msgs keyed by the destination share in the msg route dict ''' lane_stack.serviceAll() while lane_stack.rxMsgs: msg, sender = lane_stack.rxMsgs.popleft() rx_msgs[msg['route']['dst'][2]] = msg - def receive(share): ''' Returns first message from deque at key given by share in rx_msgs if any @@ -157,7 +155,6 @@ def receive(share): return rx_msgs[share].popleft() return None - def wait(share, timeout=0.0, delay=0.01): ''' Blocks until recieves a msg addressed to share or timeout From a529bd630990578221df29c7fa42e4575ba0d99d Mon Sep 17 00:00:00 2001 From: Samuel M Smith Date: Thu, 4 Dec 2014 10:18:46 -0700 Subject: [PATCH 3/4] fix bugs --- salt/utils/raetlane.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/salt/utils/raetlane.py b/salt/utils/raetlane.py index 72cf7a98d4..7a1aff80a2 100644 --- a/salt/utils/raetlane.py +++ b/salt/utils/raetlane.py @@ -118,15 +118,15 @@ def _setup(opts, ryn='manor'): sockdirpath=opts['sock_dir']) lane_stack.Pk = raeting.packKinds.pack - log.debug("Created new LaneStack and local Yard named {0} at {1}\n".format( - lane_stack.name, lane_stack.ha)) + log.debug("Created new LaneStack and local Yard named {0} at {1}\n" + "".format(lane_stack.name, lane_stack.ha)) remote_yard = RemoteYard(stack=lane_stack, name=ryn, lanename=lanename, dirpath=opts['sock_dir']) lane_stack.addRemote(remote_yard) - log.debug("Added to LaneStack {0} remote Yard named {1} at {2}\n".format( - lane_stack.name, remote_yard.name remote_yard.ha)) + log.debug("Added to LaneStack {0} remote Yard named {1} at {2}\n" + "".format(lane_stack.name, remote_yard.name, remote_yard.ha)) def transmit(msg): ''' From 076c1293902e4bfc0f42a67f966dbd5a23e6a4d6 Mon Sep 17 00:00:00 2001 From: Samuel M Smith Date: Thu, 4 Dec 2014 15:51:12 -0700 Subject: [PATCH 4/4] Fix lint errors --- salt/utils/raetlane.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/utils/raetlane.py b/salt/utils/raetlane.py index 7a1aff80a2..5ba71e3aa7 100644 --- a/salt/utils/raetlane.py +++ b/salt/utils/raetlane.py @@ -84,6 +84,7 @@ def prep(opts, ryn='manor'): if not lane_stack: _setup(opts=opts, ryn=ryn) + def _setup(opts, ryn='manor'): ''' Setup the LaneStack lane_stack and RemoteYard lane_remote_yard global @@ -128,12 +129,14 @@ def _setup(opts, ryn='manor'): log.debug("Added to LaneStack {0} remote Yard named {1} at {2}\n" "".format(lane_stack.name, remote_yard.name, remote_yard.ha)) + def transmit(msg): ''' Sends msg to remote_yard ''' lane_stack.transmit(msg, remote_yard.uid) + def service(): ''' Service the lane_stack and move any received messages into their associated @@ -144,6 +147,7 @@ def service(): msg, sender = lane_stack.rxMsgs.popleft() rx_msgs[msg['route']['dst'][2]] = msg + def receive(share): ''' Returns first message from deque at key given by share in rx_msgs if any @@ -155,6 +159,7 @@ def receive(share): return rx_msgs[share].popleft() return None + def wait(share, timeout=0.0, delay=0.01): ''' Blocks until recieves a msg addressed to share or timeout