]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr_util: rename ConnectionPool -> CephfsConnectionPool
authorJan Fajerski <jfajerski@suse.com>
Thu, 12 Mar 2020 09:34:56 +0000 (10:34 +0100)
committerKotresh HR <khiremat@redhat.com>
Mon, 28 Feb 2022 11:55:41 +0000 (17:25 +0530)
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
(cherry picked from commit 51f6f64c123533bd2d33e3ec768af63a757a1d2a)

src/pybind/mgr/mgr_util.py

index 8f61c85b1b7c6ec4e81209a2498ffc8e27b43701..d9abb208edab59842507e3c5cfcec00a76e4fc65 100644 (file)
@@ -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")