From e71c6d837dad80258e19b782ae5c472b4aff364a Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Thu, 8 Feb 2018 08:23:03 +0000 Subject: [PATCH] mgr/dashboard_v2: add more debug message to tools.py Signed-off-by: Ricardo Dias --- src/pybind/mgr/dashboard_v2/tools.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pybind/mgr/dashboard_v2/tools.py b/src/pybind/mgr/dashboard_v2/tools.py index 65c4e96eb3566..8bf5034d772e1 100644 --- a/src/pybind/mgr/dashboard_v2/tools.py +++ b/src/pybind/mgr/dashboard_v2/tools.py @@ -14,6 +14,8 @@ import threading import six import cherrypy +from . import logger + def ApiController(path): def decorate(cls): @@ -290,6 +292,7 @@ class SessionExpireAtBrowserCloseTool(cherrypy.Tool): # Shall the cookie expire at browser close? expire_at_browser_close = cherrypy.session.get( Session.EXPIRE_AT_BROWSER_CLOSE, True) + logger.debug("expire at browser close: %s", expire_at_browser_close) if expire_at_browser_close: # Get the cookie and its name. cookie = cherrypy.response.cookie @@ -297,6 +300,7 @@ class SessionExpireAtBrowserCloseTool(cherrypy.Tool): 'tools.sessions.name', Session.NAME) # Make the cookie a session cookie by purging the # fields 'expires' and 'max-age'. + logger.debug("expire at browser close: removing 'expires' and 'max-age'") if name in cookie: del cookie[name]['expires'] del cookie[name]['max-age'] @@ -322,6 +326,7 @@ class NotificationQueue(threading.Thread): return cls._running = True cls._instance = NotificationQueue() + logger.debug("starting notification queue") cls._instance.start() @classmethod @@ -335,7 +340,9 @@ class NotificationQueue(threading.Thread): cls._running = False with cls._cond: cls._cond.notify() + logger.debug("waiting for notification queue to finish") instance.join() + logger.debug("notification queue stopped") @classmethod def register(cls, func, types=None): @@ -377,8 +384,10 @@ class NotificationQueue(threading.Thread): listener(notify_value) def run(self): + logger.debug("notification queue started") while self._running: private_buffer = [] + logger.debug("NQ: processing queue: %s", len(self._queue)) try: while True: private_buffer.append(self._queue.popleft()) @@ -388,5 +397,7 @@ class NotificationQueue(threading.Thread): with self._cond: self._cond.wait(1.0) # flush remaining events + logger.debug("NQ: flush remaining events: %s", len(self._queue)) self.notify_listeners(self._queue) self._queue.clear() + logger.debug("notification queue finished") -- 2.39.5