[
https://issues.apache.org/jira/browse/CLOUDSTACK-9652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15752198#comment-15752198
]
ASF GitHub Bot commented on CLOUDSTACK-9652:
--------------------------------------------
Github user marcaurele commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1832#discussion_r92676861
--- Diff:
engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java ---
@@ -399,10 +414,22 @@ public void send(final Request req, final Listener
listener) throws AgentUnavail
try {
for (int i = 0; i < 2; i++) {
Answer[] answers = null;
+ job = _agentMgr._asyncJobDao.findById(jobId);
+ if (job != null && job.getStatus() ==
JobInfo.Status.CANCELLED) {
+ throw new
OperationCancelledException(req.getCommands(), _id, seq, wait, false);
+ }
try {
answers = sl.waitFor(wait);
+ job = _agentMgr._asyncJobDao.findById(jobId);
+ if (job != null && job.getStatus() ==
JobInfo.Status.CANCELLED) {
+ throw new
OperationCancelledException(req.getCommands(), _id, seq, wait, false);
--- End diff --
Why do you want to throw an `OperationCancelledException` if the we have
the job answer. It's better to let the normal response come back to the user.
> Job framework - Cancelling async jobs
> -------------------------------------
>
> Key: CLOUDSTACK-9652
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9652
> Project: CloudStack
> Issue Type: Improvement
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Management Server
> Reporter: Rajani Karuturi
> Assignee: Rajani Karuturi
>
> enable cancellation of long running or subsequent queued up async jobs
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)