cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.4 to c44262b
Date Mon, 01 Dec 2014 12:20:51 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 afd799677 -> c44262bfc


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

(cherry picked from commit a6ee4112a54043033233334c900d9bcd1cebf157)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.4
Commit: c44262bfc2c51bad3ec1a29fc8066dc78d90b1ad
Parents: afd7996
Author: Koushik Das <koushik@apache.org>
Authored: Mon Sep 22 16:40:12 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Dec 1 17:50:32 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/c44262bf/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 c6dd732..c2666a8 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;
 
@@ -765,16 +762,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);
@@ -812,7 +809,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/c44262bf/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 56ae5f9..ab7c21e 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