karuturi commented on a change in pull request #1832: CLOUDSTACK-9652 Job 
framework - Cancelling async jobs
URL: https://github.com/apache/cloudstack/pull/1832#discussion_r115914969
 
 

 ##########
 File path: 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);
 
 Review comment:
   I agree. will do the change.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to