Adam Litke has uploaded a new change for review.

Change subject: jobs: Drop jobs.stop
......................................................................

jobs: Drop jobs.stop

When vdsm stops we were calling jobs.stop which cleared the list of
jobs.  This is not required for vdsmd because the jobs list is not
persisted across vdsm runs.  We can use the old _clear method for test
cases which do require a way to clear the list.  Removing stop() has an
added benefit of avoiding race conditions between stop() and job
autodeletion.

Change-Id: Ifa1dc49472f429543a5335747c8e7a4b13bb3112
Signed-off-by: Adam Litke <[email protected]>
---
M lib/vdsm/jobs.py
M tests/jobsTests.py
M vdsm/vdsm
3 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/63937/1

diff --git a/lib/vdsm/jobs.py b/lib/vdsm/jobs.py
index 8c2b03f..d14080d 100644
--- a/lib/vdsm/jobs.py
+++ b/lib/vdsm/jobs.py
@@ -161,11 +161,6 @@
     _scheduler = scheduler
 
 
-def stop():
-    with _lock:
-        _jobs.clear()
-
-
 def delete(job_id):
     try:
         _delete(job_id)
@@ -222,3 +217,9 @@
         if job.active:
             raise JobNotDone("Job %r is %s" % (job_id, job.status))
         del _jobs[job_id]
+
+
+# This should only be used by test code!
+def _clear():
+    with _lock:
+        _jobs.clear()
diff --git a/tests/jobsTests.py b/tests/jobsTests.py
index c70b5e0..68ab2a2 100644
--- a/tests/jobsTests.py
+++ b/tests/jobsTests.py
@@ -74,7 +74,7 @@
         jobs.start(None)
 
     def tearDown(self):
-        jobs.stop()
+        jobs._clear()
 
     def run_job(self, job):
         self.assertEqual(jobs.STATUS.PENDING, job.status)
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 34a400c..edb82c2 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -120,7 +120,6 @@
             health.stop()
             periodic.stop()
             cif.prepareForShutdown()
-            jobs.stop()
             scheduler.stop()
     finally:
         libvirtconnection.stop_event_loop(wait=False)


-- 
To view, visit https://gerrit.ovirt.org/63937
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifa1dc49472f429543a5335747c8e7a4b13bb3112
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/admin/lists/[email protected]

Reply via email to