You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by marcaurele <gi...@git.apache.org> on 2016/12/15 19:03:19 UTC
[GitHub] cloudstack pull request #1832: CLOUDSTACK-9652 Job framework - Cancelling as...
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.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---