Dan Kenigsberg has submitted this change and it was merged.
Change subject: task: add the support for abort_callback
......................................................................
task: add the support for abort_callback
This patch adds the support for defining a callback used to
abort a long running task, e.g.:
long_operation = MyLongOperation()
def abort_long_operation():
long_operation.terminate()
# abort_callback registers the callback for the time
# of execution of the code block
with vars.task.abort_callback(abort_long_operation):
long_operation.execute()
When another thread (e.g. an external xml-rpc request) tries
to abort the task (calling "stop"), the registered callbacks
will be called.
This patch defines the basic infrastructure to register abort
functions for long running operations, the technology used to
actually implement the interruption is left to the user.
Change-Id: Ib82289e28e5ad9ea142850c31ccff3366b8397dc
Signed-off-by: Federico Simoncelli <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/33689
Reviewed-by: Dan Kenigsberg <[email protected]>
Continuous-Integration: Dan Kenigsberg <[email protected]>
Tested-by: Dan Kenigsberg <[email protected]>
---
M vdsm/storage/task.py
1 file changed, 33 insertions(+), 1 deletion(-)
Approvals:
Dan Kenigsberg: Verified; Looks good to me, approved; Passed CI tests
--
To view, visit https://gerrit.ovirt.org/33689
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib82289e28e5ad9ea142850c31ccff3366b8397dc
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Ala Hino <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Freddy Rolland <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
Gerrit-Reviewer: [email protected]
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches