cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kous...@apache.org
Subject git commit: updated refs/heads/master to a6ee411
Date Mon, 22 Sep 2014 11:47:06 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 5bddebb8f -> a6ee4112a


CLOUDSTACK-7595: Config parameters "job.expire.minutes" and "job.cancel.threshold.minutes"
incorrectly getting multiplied by a factor of 60
Removed the unnecessary multiply factor for both the config parameters. Also removed the duplicate
entries from Config.java as these are not required


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

Branch: refs/heads/master
Commit: a6ee4112a54043033233334c900d9bcd1cebf157
Parents: 5bddebb
Author: Koushik Das <koushik@apache.org>
Authored: Mon Sep 22 16:40:12 2014 +0530
Committer: Koushik Das <koushik@apache.org>
Committed: Mon Sep 22 16:45:37 2014 +0530

----------------------------------------------------------------------
 .../jobs/impl/AsyncJobManagerImpl.java          | 21 +++++++++-----------
 server/src/com/cloud/configuration/Config.java  |  9 ---------
 2 files changed, 9 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6ee4112/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 4c4d3c2..7e65ede 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
@@ -38,7 +38,6 @@ import org.apache.log4j.NDC;
 
 import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.context.CallContext;
-import org.apache.cloudstack.framework.config.ConfigDepot;
 import org.apache.cloudstack.framework.config.ConfigKey;
 import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.jobs.AsyncJob;
@@ -83,10 +82,10 @@ import com.cloud.utils.mgmt.JmxUtil;
 
 public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager, ClusterManagerListener,
Configurable {
     // Advanced
-    private static final ConfigKey<Long> JobExpireMinutes = new ConfigKey<Long>(Long.class,
"job.expire.minutes", "Advanced", "1440",
-        "Time (in minutes) for async-jobs to be kept in system", true, ConfigKey.Scope.Global,
60l);
-    private static final ConfigKey<Long> JobCancelThresholdMinutes = new ConfigKey<Long>(Long.class,
"job.cancel.threshold.minutes", "Advanced", "60",
-            "Time (in minutes) for async-jobs to be forcely cancelled if it has been in process
for long", true, ConfigKey.Scope.Global, 240l);
+    private static final ConfigKey<Long> JobExpireMinutes = new ConfigKey<Long>("Advanced",
Long.class, "job.expire.minutes", "1440",
+        "Time (in minutes) for async-jobs to be kept in system", true, ConfigKey.Scope.Global);
+    private static final ConfigKey<Long> JobCancelThresholdMinutes = new ConfigKey<Long>("Advanced",
Long.class, "job.cancel.threshold.minutes", "60",
+        "Time (in minutes) for async-jobs to be forcely cancelled if it has been in process
for long", true, ConfigKey.Scope.Global);
 
     private static final Logger s_logger = Logger.getLogger(AsyncJobManagerImpl.class);
 
@@ -112,8 +111,6 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
     private MessageBus _messageBus;
     @Inject
     private AsyncJobMonitor _jobMonitor;
-    @Inject
-    private ConfigDepot _configDepot;
 
     private volatile long _executionRunNumber = 1;
 
@@ -778,16 +775,16 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
 
                     // limit to 100 jobs per turn, this gives cleanup throughput as 600 jobs
per minute
                     // hopefully this will be fast enough to balance potential growth of
job table
-                    //1) Expire unfinished jobs that weren't processed yet
-                    List<AsyncJobVO> l = _jobDao.getExpiredUnfinishedJobs(cutTime,
100);
-                    for (AsyncJobVO job : l) {
+                    // 1) Expire unfinished jobs that weren't processed yet
+                    List<AsyncJobVO> unfinishedJobs = _jobDao.getExpiredUnfinishedJobs(cutTime,
100);
+                    for (AsyncJobVO job : unfinishedJobs) {
                         s_logger.info("Expunging unfinished job " + job);
 
                         _jobMonitor.unregisterByJobId(job.getId());
                         expungeAsyncJob(job);
                     }
 
-                    //2) Expunge finished jobs
+                    // 2) Expunge finished jobs
                     List<AsyncJobVO> completedJobs = _jobDao.getExpiredCompletedJobs(cutTime,
100);
                     for (AsyncJobVO job : completedJobs) {
                         s_logger.trace("Expunging completed job " + job);
@@ -825,7 +822,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
             @Override
             public void doInTransactionWithoutResult(TransactionStatus status) {
                 _jobDao.expunge(job.getId());
-                //purge corresponding sync queue item
+                // purge corresponding sync queue item
                 _queueMgr.purgeAsyncJobQueueItemId(job.getId());
             }
         });

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a6ee4112/server/src/com/cloud/configuration/Config.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java
index 9309e3a..83badbc 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -521,15 +521,6 @@ public enum Config {
     KVMSnapshotEnabled("Snapshots", SnapshotManager.class, Boolean.class, "kvm.snapshot.enabled",
"false", "whether snapshot is enabled for KVM hosts", null),
 
     // Advanced
-    JobExpireMinutes("Advanced", ManagementServer.class, String.class, "job.expire.minutes",
"1440", "Time (in minutes) for async-jobs to be kept in system", null),
-    JobCancelThresholdMinutes(
-            "Advanced",
-            ManagementServer.class,
-            String.class,
-            "job.cancel.threshold.minutes",
-            "60",
-            "Time (in minutes) for async-jobs to be forcely cancelled if it has been in process
for long",
-            null),
     EventPurgeInterval(
             "Advanced",
             ManagementServer.class,


Mime
View raw message