From: Jan Fajerski Date: Thu, 12 Mar 2020 09:34:56 +0000 (+0100) Subject: mgr_util: rename ConnectionPool -> CephfsConnectionPool X-Git-Tag: v15.2.17~108^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b6de15979afd6c04a7e1c4c6a2ded43d2d7ef24;p=ceph.git mgr_util: rename ConnectionPool -> CephfsConnectionPool Signed-off-by: Jan Fajerski (cherry picked from commit 51f6f64c123533bd2d33e3ec768af63a757a1d2a) --- diff --git a/src/pybind/mgr/mgr_util.py b/src/pybind/mgr/mgr_util.py index 8f61c85b1b7..d9abb208eda 100644 --- a/src/pybind/mgr/mgr_util.py +++ b/src/pybind/mgr/mgr_util.py @@ -52,7 +52,7 @@ class CephfsConnectionException(Exception): return "{0} ({1})".format(self.errno, self.error_str) -class ConnectionPool(object): +class CephfsConnectionPool(object): class Connection(object): def __init__(self, mgr, fs_name): self.fs = None @@ -150,7 +150,7 @@ class ConnectionPool(object): self.function(*self.args, **self.kwargs) self.finished.set() except Exception as e: - logger.error("ConnectionPool.RTimer: %s", e) + logger.error("CephfsConnectionPool.RTimer: %s", e) raise # TODO: make this configurable @@ -162,8 +162,8 @@ class ConnectionPool(object): self.connections = {} self.lock = Lock() self.cond = Condition(self.lock) - self.timer_task = ConnectionPool.RTimer( - ConnectionPool.TIMER_TASK_RUN_INTERVAL, + self.timer_task = CephfsConnectionPool.RTimer( + CephfsConnectionPool.TIMER_TASK_RUN_INTERVAL, self.cleanup_connections) self.timer_task.start() @@ -171,7 +171,7 @@ class ConnectionPool(object): with self.lock: logger.info("scanning for idle connections..") idle_fs = [fs_name for fs_name, conn in self.connections.items() - if conn.is_connection_idle(ConnectionPool.CONNECTION_IDLE_INTERVAL)] + if conn.is_connection_idle(CephfsConnectionPool.CONNECTION_IDLE_INTERVAL)] for fs_name in idle_fs: logger.info("cleaning up connection for '{}'".format(fs_name)) self._del_fs_handle(fs_name) @@ -190,7 +190,7 @@ class ConnectionPool(object): # same name) via "ceph fs rm/new" mon command. logger.warning("filesystem id changed for volume '{0}', reconnecting...".format(fs_name)) self._del_fs_handle(fs_name) - conn = ConnectionPool.Connection(self.mgr, fs_name) + conn = CephfsConnectionPool.Connection(self.mgr, fs_name) conn.connect() except cephfs.Error as e: # try to provide a better error string if possible @@ -231,7 +231,7 @@ class CephfsClient(object): def __init__(self, mgr): self.mgr = mgr self.stopping = Event() - self.connection_pool = ConnectionPool(self.mgr) + self.connection_pool = CephfsConnectionPool(self.mgr) def shutdown(self): logger.info("shutting down")