Repository: cloudstack
Updated Branches:
  refs/heads/bugfix/CID-1230585 [created] d2aa1c4aa


Fix concurrency issues CID-1230585 and CID-1230586

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d2aa1c4a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d2aa1c4a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d2aa1c4a

Branch: refs/heads/bugfix/CID-1230585
Commit: d2aa1c4aa1c9c0993fb5e68af189d011c258e35d
Parents: 9d7b851
Author: Hugo Trippaers <htrippa...@schubergphilis.com>
Authored: Wed Aug 13 08:39:40 2014 +0200
Committer: Hugo Trippaers <htrippa...@schubergphilis.com>
Committed: Wed Aug 13 08:39:40 2014 +0200

----------------------------------------------------------------------
 core/src/com/cloud/resource/ServerResourceBase.java | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d2aa1c4a/core/src/com/cloud/resource/ServerResourceBase.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/resource/ServerResourceBase.java 
b/core/src/com/cloud/resource/ServerResourceBase.java
index 082067f..a24ea98 100755
--- a/core/src/com/cloud/resource/ServerResourceBase.java
+++ b/core/src/com/cloud/resource/ServerResourceBase.java
@@ -26,6 +26,7 @@ import java.net.SocketException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Enumeration;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -100,9 +101,9 @@ public abstract class ServerResourceBase implements 
ServerResource {
                 final String nicName = nic.getName();
                 //  try {
                 if (//!nic.isLoopback() &&
-                    //nic.isUp() &&
-                !nic.isVirtual() && !nicName.startsWith("vnif") && 
!nicName.startsWith("vnbr") && !nicName.startsWith("peth") && 
!nicName.startsWith("vif") &&
-                    !nicName.startsWith("virbr") && !nicName.contains(":")) {
+                        //nic.isUp() &&
+                        !nic.isVirtual() && !nicName.startsWith("vnif") && 
!nicName.startsWith("vnbr") && !nicName.startsWith("peth") && 
!nicName.startsWith("vif") &&
+                        !nicName.startsWith("virbr") && 
!nicName.contains(":")) {
                     final String[] info = NetUtils.getNicParams(nicName);
                     if (info != null && info[0] != null) {
                         _privateNic = nic;
@@ -237,16 +238,16 @@ public abstract class ServerResourceBase implements 
ServerResource {
 
     protected List<String> getWarnings() {
         synchronized (_warnings) {
-            final ArrayList<String> results = _warnings;
-            _warnings = new ArrayList<String>();
+            final List<String> results = new LinkedList<String>(_warnings);
+            _warnings.clear();
             return results;
         }
     }
 
     protected List<String> getErrors() {
         synchronized (_errors) {
-            final ArrayList<String> result = _errors;
-            _errors = new ArrayList<String>();
+            final List<String> result = new LinkedList<String>(_errors);
+            _errors.clear();
             return result;
         }
     }

Reply via email to