From d81bc5a375496b69d3db35dcf16ad420eb0add32 Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Tue, 30 Aug 2011 22:09:28 -0700 Subject: [PATCH] Dequeue the vm with the largest id first -- this ensures that newly started vms get updated early --- .../network/security/LocalSecurityGroupWorkQueue.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/network/security/LocalSecurityGroupWorkQueue.java b/server/src/com/cloud/network/security/LocalSecurityGroupWorkQueue.java index 0486927a1f8..4b7c3225a33 100644 --- a/server/src/com/cloud/network/security/LocalSecurityGroupWorkQueue.java +++ b/server/src/com/cloud/network/security/LocalSecurityGroupWorkQueue.java @@ -39,8 +39,8 @@ import com.cloud.network.security.SecurityGroupWork.Step; public class LocalSecurityGroupWorkQueue implements SecurityGroupWorkQueue { protected static Logger s_logger = Logger.getLogger(LocalSecurityGroupWorkQueue.class); - protected Set _currentWork = new HashSet(); - //protected Set _currentWork = new TreeSet(); + //protected Set _currentWork = new HashSet(); + protected Set _currentWork = new TreeSet(); private final ReentrantLock _lock = new ReentrantLock(); private final Condition _notEmpty = _lock.newCondition(); @@ -85,7 +85,9 @@ public class LocalSecurityGroupWorkQueue implements SecurityGroupWorkQueue { @Override public int compareTo(LocalSecurityGroupWork o) { - return this._instanceId.compareTo(o.getInstanceId()); + //return this._instanceId.compareTo(o.getInstanceId()); + return o.getInstanceId().compareTo(this.getInstanceId()); + } @Override