Bug 1425882 - [RFE] provide a way to cancel (specific) jobs
Summary: [RFE] provide a way to cancel (specific) jobs
Keywords:
Status: NEW
Alias: None
Product: LVM and device-mapper
Classification: Community
Component: lvm2
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: LVM Team
QA Contact: cluster-qe
URL:
Whiteboard:
Depends On: 1427323 1563827 1595334
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-22 16:24 UTC by Vratislav Podzimek
Modified: 2023-08-10 15:40 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:
rule-engine: lvm-technical-solution?
rule-engine: lvm-test-coverage?


Attachments (Terms of Use)

Description Vratislav Podzimek 2017-02-22 16:24:49 UTC
Description of problem:
The lvm2-dbusd API returns Job objects for actions being performed. The Job objects provide results, progress and other features as described at https://github.com/tasleson/lvm-dubstep/blob/master/api.md#interface-comredhatlvmdbus1job

However, there's no way to cancel a Job. For example a job for 'pvmove' can take a very log time while the underlying operation can be safely canceled. It would be nice if the com.redhat.lvmdbus1.Job interface provided a Cancel() method or there was a new com.redhat.lvmdbus1.Job.Cancellable interface providing such method at least for specific types of actions. (If the Cancel() method is added to the com.redhat.lvmdbus1.Job interface, it may just return error if the action it runs doesn't support cancellation)

Comment 1 Tony Asleson 2017-02-23 22:00:50 UTC
The only thing we can interrupt is pvmove(s).  However, lvm only gives us the ability to abort *all* outstanding moves, not specific ones.  I will follow-up with the lvm team on if we could provide a mechanism to abort specific move operations.  Otherwise I think we are only left with something like Manager.PvMoveAbort().

Comment 2 Alasdair Kergon 2017-02-24 01:04:21 UTC
The command line is supposed to work in exactly the same way as other options - if you give additional arguments it's supposed to use them to identify the pvmove(s) the action applies to.  Is this facility missing from the API?

Comment 3 Tony Asleson 2017-02-24 16:14:48 UTC
(In reply to Alasdair Kergon from comment #2)
> The command line is supposed to work in exactly the same way as other
> options - if you give additional arguments it's supposed to use them to
> identify the pvmove(s) the action applies to.  

OK I incorrectly concluded from the man page:

"--abort
     Abort  any moves in progress.  If the --atomic option was used to start
     the pvmove, all logical volumes will remain on the source physical vol‐
     ume.   Otherwise, those segments that have completed the move will stay
     on the destination physical volume, while  those  that  have  not  will
     remain on the source physical volume."

that `pvmove --abort` was the only option (which does indeed work).  In empirical testing it appears that you can select a specific move to abort.

> Is this facility missing from
> the API?

Yes, thus the reason for this specific BZ

Comment 4 Vratislav Podzimek 2017-02-28 15:16:27 UTC
> OK I incorrectly concluded from the man page:...

Same here. Looks like the man page needs to be more explicit.


Note You need to log in before you can comment on or make changes to this bug.