]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #60117 from rishabh-d-dave/mgr-vol-base-init
authorRishabh Dave <ridave@redhat.com>
Fri, 25 Oct 2024 13:10:59 +0000 (18:40 +0530)
committerGitHub <noreply@github.com>
Fri, 25 Oct 2024 13:10:59 +0000 (18:40 +0530)
mgr/vol: better to call base class __init__() at beginning

Reviewed-by: Milind Changire <mchangir@redhat.com>
Reviewed-by: Venky Shankar <vshankar@redhat.com>
1  2 
src/pybind/mgr/volumes/fs/async_job.py

index 80da091c88b7872c149f269e48b395013883f76c,d8c0d0a3fbc7dd7806347f45aa687add5a398464..075fedf20a46171d0d2748b1ab08c4b938842e7c
@@@ -117,17 -118,12 +118,18 @@@ class AsyncJobs(threading.Thread)
  
      def __init__(self, volume_client, name_pfx, nr_concurrent_jobs):
          threading.Thread.__init__(self, name="{0}.tick".format(name_pfx))
          self.vc = volume_client
 -        # queue of volumes for starting async jobs
 +        # self.q is a deque of names of a volumes for which async jobs needs
 +        # to be started.
          self.q = deque()  # type: deque
 -        # volume => job tracking
 +
 +        # self.jobs is a dictionary where volume name is the key and value is
 +        # a tuple containing two members: the async job and an instance of
 +        # threading.Thread that performs that job.
 +        # in short, self.jobs = {volname: (async_job, thread instance)}.
          self.jobs = {}
 +
          # lock, cv for kickstarting jobs
          self.lock = threading.Lock()
          self.cv = threading.Condition(self.lock)