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.3 to e0ea880
Date Mon, 01 Dec 2014 12:19:47 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.3 4e33d359a -> e0ea8801f


CLOUDSTACK-7595: Remove unnecessary multiply factor for job expiry

Backported using a6ee4112a54043033233334c900d9bcd1cebf157 by
Koushik Das <koushik@apache.org>

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

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/e0ea8801
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e0ea8801
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e0ea8801

Branch: refs/heads/4.3
Commit: e0ea8801fb501282e5358b05c0c648dc6ee76739
Parents: 4e33d35
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Mon Dec 1 17:48:17 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Dec 1 17:48:17 2014 +0530

----------------------------------------------------------------------
 .../framework/jobs/impl/AsyncJobManagerImpl.java    | 16 +++++++---------
 server/src/com/cloud/configuration/Config.java      |  1 -
 2 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0ea8801/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 ae59848..beeb025 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
@@ -36,7 +36,6 @@ import javax.naming.ConfigurationException;
 import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.ApiErrorCode;
-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;
@@ -82,10 +81,11 @@ 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, 60l);
+    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 +112,6 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
     private MessageBus _messageBus;
     @Inject
     private AsyncJobMonitor _jobMonitor;
-    @Inject
-    private ConfigDepot _configDepot;
 
     private volatile long _executionRunNumber = 1;
 
@@ -734,8 +732,8 @@ 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) {
+                    List<AsyncJobVO> unfinishedJobs = _jobDao.getExpiredUnfinishedJobs(cutTime,
100);
+                    for (AsyncJobVO job : unfinishedJobs) {
                         s_logger.trace("Expunging unfinished job " + job);
                         expungeAsyncJob(job);
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e0ea8801/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 ee48002..1bfad1e 100755
--- a/server/src/com/cloud/configuration/Config.java
+++ b/server/src/com/cloud/configuration/Config.java
@@ -141,7 +141,6 @@ public enum Config {
 
 	// 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, Integer.class, "event.purge.interval",
"86400", "The interval (in seconds) to wait before running the event purge thread", null),
 	AccountCleanupInterval("Advanced", ManagementServer.class, Integer.class, "account.cleanup.interval",
"86400", "The interval (in seconds) between cleanup for removed accounts", null),
 	InstanceName("Advanced", AgentManager.class, String.class, "instance.name", "VM", "Name
of the deployment instance.", "instanceName"),


Mime
View raw message