diff options
author | Rishabh Dave <ridave@redhat.com> | 2024-10-24 13:24:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-24 13:24:50 +0200 |
commit | a35e7b26da44e79ecc1e102f10f77831d9e2609e (patch) | |
tree | 9af65a69c0a0fae8d63ceadd328f6d19823759c5 | |
parent | Merge pull request #60042 from sunilangadi2/migration_with_namespace_test (diff) | |
parent | mgr/vol: add comments to explain queuing data structures (diff) | |
download | ceph-a35e7b26da44e79ecc1e102f10f77831d9e2609e.tar.xz ceph-a35e7b26da44e79ecc1e102f10f77831d9e2609e.zip |
Merge pull request #60119 from rishabh-d-dave/mgr-vol-comments
mgr/vol: add comments to explain queuing data structures
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Reviewed-by: Jos Collin <jcollin@redhat.com>
-rw-r--r-- | src/pybind/mgr/volumes/fs/async_job.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pybind/mgr/volumes/fs/async_job.py b/src/pybind/mgr/volumes/fs/async_job.py index 83a119ca556..6cb8d9581ae 100644 --- a/src/pybind/mgr/volumes/fs/async_job.py +++ b/src/pybind/mgr/volumes/fs/async_job.py @@ -118,10 +118,16 @@ 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) |