Updated Branches: refs/heads/object_store 57049d5ae -> 913e2b38b
CLOUDSTACK-2523: Recurring snapshot failed with NPE. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/913e2b38 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/913e2b38 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/913e2b38 Branch: refs/heads/object_store Commit: 913e2b38bfe5b29c0c172171e83d4fb7f8a8e6d6 Parents: d1704a3 Author: Min Chen <[email protected]> Authored: Thu May 23 17:22:44 2013 -0700 Committer: Min Chen <[email protected]> Committed: Thu May 23 17:23:25 2013 -0700 ---------------------------------------------------------------------- .../storage/snapshot/SnapshotSchedulerImpl.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/913e2b38/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java index 5af0af0..9b6d218 100644 --- a/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotSchedulerImpl.java @@ -56,6 +56,7 @@ import com.cloud.utils.DateUtil; import com.cloud.utils.DateUtil.IntervalType; import com.cloud.utils.NumbersUtil; +import com.cloud.utils.component.ComponentContext; import com.cloud.utils.component.ManagerBase; import com.cloud.utils.concurrency.TestClock; import com.cloud.utils.db.DB; @@ -75,7 +76,7 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu @Inject protected AsyncJobManager _asyncMgr; @Inject protected VolumeDao _volsDao; @Inject protected ConfigurationDao _configDao; - + private static final int ACQUIRE_GLOBAL_LOCK_TIMEOUT_FOR_COOPERATION = 5; // 5 seconds private int _snapshotPollInterval; private Timer _testClockTimer; @@ -246,6 +247,7 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu params.put("ctxStartEventId", String.valueOf(eventId)); CreateSnapshotCmd cmd = new CreateSnapshotCmd(); + ComponentContext.inject(cmd); ApiDispatcher.getInstance().dispatchCreateCmd(cmd, params); params.put("id", ""+cmd.getEntityId()); params.put("ctxStartEventId", "1"); @@ -350,7 +352,7 @@ public class SnapshotSchedulerImpl extends ManagerBase implements SnapshotSchedu _testTimerTask = new TestClock(this, minutesPerHour, hoursPerDay, daysPerWeek, daysPerMonth, weeksPerMonth, monthsPerYear); } _currentTimestamp = new Date(); - + s_logger.info("Snapshot Scheduler is configured."); return true;
