Nir Soffer has posted comments on this change.

Change subject: jobs: Autodelete
......................................................................


Patch Set 3:

(3 comments)

Mostly good, we have to implement state changes and make it thread safe (next 
patch?)

https://gerrit.ovirt.org/#/c/62002/3/lib/vdsm/jobs.py
File lib/vdsm/jobs.py:

Line 120:     def active(self):
Line 121:         return self.status in (STATUS.PENDING, STATUS.RUNNING)
Line 122: 
Line 123:     def abort(self):
Line 124:         # TODO: Don't abort if not pending and not running
We should do this now
Line 125:         self._status = STATUS.ABORTED
Line 126:         logging.info('Job %r aborting...', self._id)
Line 127:         self._abort()
Line 128:         if self.autodelete:


Line 128:         if self.autodelete:
Line 129:             self._autodelete()
Line 130: 
Line 131:     def run(self):
Line 132:         # TODO: Don't run if aborted or not pending
We should do this now - you can submit this in another patch to keep this patch 
small if you like.
Line 133:         self._status = STATUS.RUNNING
Line 134:         try:
Line 135:             self._run()
Line 136:         except Exception as e:


https://gerrit.ovirt.org/#/c/62002/3/tests/jobsTests.py
File tests/jobsTests.py:

Line 277:         job = AutodeleteJob(exception=error)
Line 278:         jobs.add(job)
Line 279:         with MonkeyPatchScope([(jobs, 'config', cfg)]):
Line 280:             self.run_job(job)
Line 281:             time.sleep(0.1)  # Wait for the scheduler
Fragile, use fake scheduler instead.
Line 282:             self.assertRaises(jobs.NoSuchJob, jobs.get, job.id)
Line 283: 
Line 284:     def test_autodelete_when_aborted(self):
Line 285:         cfg = make_config([('jobs', 'autodelete_delay', '0')])


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4aafd2271397bd9bc4289dc1aab723398d475add
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org

Reply via email to