Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 13BDF1758F for ; Fri, 18 Sep 2015 21:22:16 +0000 (UTC) Received: (qmail 72420 invoked by uid 500); 18 Sep 2015 21:22:15 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 72364 invoked by uid 500); 18 Sep 2015 21:22:15 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 72353 invoked by uid 99); 18 Sep 2015 21:22:15 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Sep 2015 21:22:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 47DE4E0664; Fri, 18 Sep 2015 21:22:15 +0000 (UTC) From: jburwell To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org References: In-Reply-To: Subject: [GitHub] cloudstack pull request: CLOUDSTACK-8832 : Update Nuage VSP plugin... Content-Type: text/plain Message-Id: <20150918212215.47DE4E0664@git1-us-west.apache.org> Date: Fri, 18 Sep 2015 21:22:15 +0000 (UTC) Github user jburwell commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/801#discussion_r39902498 --- Diff: plugins/network-elements/nuage-vsp/src/com/cloud/network/guru/NuageVspGuestNetworkGuru.java --- @@ -322,35 +383,57 @@ public void shutdown(NetworkProfile profile, NetworkOffering offering) { @Override public boolean trash(Network network, NetworkOffering offering) { - - s_logger.debug("Handling trash() call back to delete the network " + network.getName() + " with uuid " + network.getUuid() + " from VSP"); - long domainId = network.getDomainId(); - Domain domain = _domainDao.findById(domainId); - Long vpcId = network.getVpcId(); - String vpcUuid = null; - if (vpcId != null) { - Vpc vpcObj = _vpcDao.findById(vpcId); - vpcUuid = vpcObj.getUuid(); + long networkId = network.getId(); + network = _networkDao.acquireInLockTable(networkId, 1200); + if (network == null) { + throw new ConcurrentOperationException("Unable to acquire lock on network " + networkId); } + try { - HostVO nuageVspHost = getNuageVspHost(network.getPhysicalNetworkId()); - TrashNetworkVspCommand cmd = new TrashNetworkVspCommand(domain.getUuid(), network.getUuid(), isL3Network(offering.getId()), vpcUuid); - TrashNetworkVspAnswer answer = (TrashNetworkVspAnswer)_agentMgr.easySend(nuageVspHost.getId(), cmd); - if (answer == null || !answer.getResult()) { - s_logger.error("TrashNetworkNuageVspCommand for network " + network.getUuid() + " failed"); - if ((null != answer) && (null != answer.getDetails())) { - s_logger.error(answer.getDetails()); + s_logger.debug("Handling trash() call back to delete the network " + network.getName() + " with uuid " + network.getUuid() + " from VSP"); --- End diff -- Wrap in a if (s_logger.isDebugEnabled()) { ... } block to avoid unnecessary pressure on the string pool when debug logging is not enabled. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---