Release acquired lock for VPC

This commit is contained in:
Alena Prokharchyk 2012-06-11 14:31:39 -07:00
parent 3b943d84dd
commit d1598e366e
3 changed files with 18 additions and 16 deletions

View File

@ -1075,6 +1075,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
txn.commit();
} finally {
if (accountToLock != null) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Releasing lock account " + ipOwner);
}
_accountDao.releaseFromLockTable(ipOwner.getId());
s_logger.debug("Associate IP address lock released");
}
@ -1990,6 +1993,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
shutdownNetwork(networkId, context, false);
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("Releasing lock for network id " + networkId);
}
_networksDao.releaseFromLockTable(networkId);
}
}

View File

@ -19,8 +19,6 @@ import javax.ejb.Local;
import org.apache.log4j.Logger;
import sun.security.jca.ProviderList;
import com.cloud.deploy.DataCenterDeployment;
import com.cloud.deploy.DeployDestination;
import com.cloud.deploy.DeploymentPlan;
@ -91,19 +89,17 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
Pair<DeploymentPlan, List<DomainRouterVO>> planAndRouters = getDeploymentPlanAndRouters(vpc.getId(), dest);
DeploymentPlan plan = planAndRouters.first();
List<DomainRouterVO> routers = planAndRouters.second();
//2) Return routers if exist
if (routers.size() >= 1) {
return routers;
}
Long offeringId = _vpcOffDao.findById(vpc.getVpcOfferingId()).getServiceOfferingId();
if (offeringId == null) {
offeringId = _offering.getId();
}
//3) Deploy Virtual Router
try {
try {
//2) Return routers if exist
if (routers.size() >= 1) {
return routers;
}
Long offeringId = _vpcOffDao.findById(vpc.getVpcOfferingId()).getServiceOfferingId();
if (offeringId == null) {
offeringId = _offering.getId();
}
//3) Deploy Virtual Router
List<? extends PhysicalNetwork> pNtwks = _pNtwkDao.listByZone(vpc.getZoneId());
VirtualRouterProvider vpcVrProvider = null;

View File

@ -5,7 +5,7 @@
# if you change 'em here, you need to change it also in cloud.spec, add a %changelog entry there, and add an entry in debian/changelog
VERSION = '3.0.3.2012-06-11T20:32:53Z'
VERSION = '3.0.3.2012-06-11T21:29:17Z'
APPNAME = 'cloud'
import shutil,os