At Fri, 26 Feb 2016 17:29:43 +0000,
Victor Orlikowski wrote:
> 
> [1  <text/plain; us-ascii (quoted-printable)>]
> Protect events queue with a semaphore, due to a discovered bug in eventlet 
> queue put(). This is a temporary workaround until eventlet is fixed.
> 
> Signed-off-by: Victor J. Orlikowski <[email protected]>

I made a patch for analysing eventlet performance issue a while ago.

https://github.com/toshiiw/eventlet/tree/hub-logging

This may or may not help debugging the eventlet bug you mentioned.
The eventlet semaphore and queue use different code for thread
sleep/wake-up and I'm suspecting there may be some corner-case in the
eventlet ItemWaiter.

Happy debugging (if you like.)


> ---
>  ryu/base/app_manager.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/ryu/base/app_manager.py b/ryu/base/app_manager.py
> index 3d5d895..cc51008 100644
> --- a/ryu/base/app_manager.py
> +++ b/ryu/base/app_manager.py
> @@ -158,6 +158,7 @@ class RyuApp(object):
>          self.threads = []
>          self.main_thread = None
>          self.events = hub.Queue(128)
> +        self._events_sem = hub.BoundedSemaphore(self.events.maxsize)
>          if hasattr(self.__class__, 'LOGGER_NAME'):
>              self.logger = logging.getLogger(self.__class__.LOGGER_NAME)
>          else:
> @@ -280,6 +281,7 @@ class RyuApp(object):
>      def _event_loop(self):
>          while self.is_active or not self.events.empty():
>              ev, state = self.events.get()
> +            self._events_sem.release()
>              if ev == self._event_stop:
>                  continue
>              handlers = self.get_handlers(ev, state)
> @@ -287,6 +289,7 @@ class RyuApp(object):
>                  handler(ev)
>  
>      def _send_event(self, ev, state):
> +        self._events_sem.acquire()
>          self.events.put((ev, state))
>  
>      def send_event(self, name, ev, state=None):
> -- 
> 
> Best,
> Victor
> --
> Victor J. Orlikowski <> vjo@[cs.]duke.edu
> 
> [2 0001-Protect-events-queue-with-a-semaphore-due-to-a-disco.patch 
> <application/octet-stream (base64)>]
> [3  <text/plain; us-ascii (7bit)>]
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> [4  <text/plain; us-ascii (7bit)>]
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to