cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [2/2] git commit: updated refs/heads/4.4 to 850e068
Date Tue, 20 May 2014 12:27:14 GMT
CLOUDSTACK-6720: Async job events are not published on event bus

fix ensures publishOnEventBus() is called on submit, update, complete
phase of job procesing


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/850e068a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/850e068a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/850e068a

Branch: refs/heads/4.4
Commit: 850e068a56382ea4f8c898d3307c8ce8bec6e9c5
Parents: 019ac69
Author: Murali Reddy <muralimmreddy@gmail.com>
Authored: Tue May 20 16:49:51 2014 +0530
Committer: Daan Hoogland <daan@onecht.net>
Committed: Tue May 20 14:27:03 2014 +0200

----------------------------------------------------------------------
 .../cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/850e068a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index 24abcbe..c6dd732 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -172,6 +172,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
         job.setSyncSource(null);        // no sync source originally
         dao.persist(job);
 
+        publishOnEventBus(job, "submit");
         scheduleExecution(job, scheduleJobExecutionInContext);
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("submit async job-" + job.getId() + ", details: " + job.toString());
@@ -193,6 +194,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
                     job.setInitMsid(getMsid());
                     dao.persist(job);
 
+                    publishOnEventBus(job, "submit");
                     syncAsyncJobExecution(job, syncObjType, syncObjId, 1);
 
                     return job.getId();
@@ -230,6 +232,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             return;
         }
 
+        publishOnEventBus(job, "complete"); // publish before the instance type and ID are
wiped out
         List<Long> wakeupList = Transaction.execute(new TransactionCallback<List<Long>>()
{
             @Override
             public List<Long> doInTransaction(TransactionStatus status) {
@@ -287,6 +290,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             return;
         }
 
+        publishOnEventBus(job, "update");
         Transaction.execute(new TransactionCallbackNoReturn() {
             @Override
             public void doInTransactionWithoutResult(TransactionStatus status) {
@@ -307,6 +311,9 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             s_logger.debug("Update async-job attachment, job-" + jobId + ", instanceType:
" + instanceType + ", instanceId: " + instanceId);
         }
 
+        final AsyncJobVO job = _jobDao.findById(jobId);
+        publishOnEventBus(job, "update");
+
         Transaction.execute(new TransactionCallbackNoReturn() {
             @Override
             public void doInTransactionWithoutResult(TransactionStatus status) {


Mime
View raw message