Skip to content

Commit a35e7b2

Browse files
Merge pull request ceph#60119 from rishabh-d-dave/mgr-vol-comments
mgr/vol: add comments to explain queuing data structures Reviewed-by: Venky Shankar <[email protected]> Reviewed-by: Jos Collin <[email protected]>
2 parents dcd399e + 8f7c5f0 commit a35e7b2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pybind/mgr/volumes/fs/async_job.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,16 @@ class AsyncJobs(threading.Thread):
118118
def __init__(self, volume_client, name_pfx, nr_concurrent_jobs):
119119
threading.Thread.__init__(self, name="{0}.tick".format(name_pfx))
120120
self.vc = volume_client
121-
# queue of volumes for starting async jobs
121+
# self.q is a deque of names of a volumes for which async jobs needs
122+
# to be started.
122123
self.q = deque() # type: deque
123-
# volume => job tracking
124+
125+
# self.jobs is a dictionary where volume name is the key and value is
126+
# a tuple containing two members: the async job and an instance of
127+
# threading.Thread that performs that job.
128+
# in short, self.jobs = {volname: (async_job, thread instance)}.
124129
self.jobs = {}
130+
125131
# lock, cv for kickstarting jobs
126132
self.lock = threading.Lock()
127133
self.cv = threading.Condition(self.lock)

0 commit comments

Comments
 (0)