bhouse-nexthop commented on code in PR #14640:
URL: https://github.com/apache/cloudstack/pull/14640#discussion_r4757103126


##########
core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java:
##########
@@ -89,8 +90,12 @@ public class VirtualRoutingResource {
 
     protected Logger logger = LogManager.getLogger(getClass());
     private VirtualRouterDeployer _vrDeployer;
+    // Agent request threads run in parallel, so these maps are synchronized. 
The aggregation maps are
+    // only read and changed for a router while holding that router's lock 
from _vrLockMap.
     private Map<String, Queue<NetworkElementCommand>> _vrAggregateCommandsSet;

Review Comment:
   Will do. I'll put that comment on the field itself. See my reply on the 
review for where the rest of this is heading.
   



##########
core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java:
##########
@@ -89,8 +90,12 @@ public class VirtualRoutingResource {
 
     protected Logger logger = LogManager.getLogger(getClass());
     private VirtualRouterDeployer _vrDeployer;
+    // Agent request threads run in parallel, so these maps are synchronized. 
The aggregation maps are
+    // only read and changed for a router while holding that router's lock 
from _vrLockMap.
     private Map<String, Queue<NetworkElementCommand>> _vrAggregateCommandsSet;
-    protected Map<String, Lock> _vrLockMap = new HashMap<String, Lock>();
+    // Router name -> failure details of the last aggregated apply on it, if 
that apply failed
+    private Map<String, String> _vrAggregateFailures;

Review Comment:
   Agreed on both points, and on your follow-up: one stored failure per router 
isn't enough. jmsperu's runs show two cases where it gives the wrong answer. 
I've laid out why in my reply on the review, along with a proposal (an 
aggregation id on Start, the queued commands and Finish). I'd like your view on 
whether that goes in this PR or a follow-up before I change the code.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to