CLOUDSTACK-7721. Runtime exception while trying to release lock on template_spool_ref. When a template a copied from a secondary to primary, we were trying to release a lock twice, once in the create/copy base image function and in the create/copy base image complete callback routine. This caused the exception as reported in the bug. Fixed by updating the code make sure we release the lock in copy base image function only as this is the place we took acquired the lock.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/cf27ecd9 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/cf27ecd9 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/cf27ecd9 Branch: refs/heads/statscollector-graphite Commit: cf27ecd91d22ba87930d7b50f1411afa38914351 Parents: a8b89be Author: Devdeep Singh <devd...@gmail.com> Authored: Mon Nov 10 10:36:01 2014 +0530 Committer: Devdeep Singh <devd...@gmail.com> Committed: Mon Nov 10 13:22:39 2014 +0530 ---------------------------------------------------------------------- .../org/apache/cloudstack/storage/volume/VolumeServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cf27ecd9/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java index 21e65f9..9c45cb8 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java @@ -559,14 +559,12 @@ public class VolumeServiceImpl implements VolumeService { DataObject templateOnPrimaryStoreObj = context.destObj; if (!result.isSuccess()) { templateOnPrimaryStoreObj.processEvent(Event.OperationFailed); - _tmpltPoolDao.releaseFromLockTable(context.getTemplatePoolId()); res.setResult(result.getResult()); future.complete(res); return null; } templateOnPrimaryStoreObj.processEvent(Event.OperationSuccessed, result.getAnswer()); - _tmpltPoolDao.releaseFromLockTable(context.getTemplatePoolId()); createVolumeFromBaseImageAsync(context.volume, templateOnPrimaryStoreObj, context.dataStore, future); return null; }