DaanHoogland commented on code in PR #14640:
URL: https://github.com/apache/cloudstack/pull/14640#discussion_r4755440807
##########
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:
```suggestion
// must be synchronized as it is used by multiple agents in parallel
private Map<String, Queue<NetworkElementCommand>> _vrAggregateCommandsSet;
```
##########
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:
```suggestion
// failure per routername
private Map<String, String> _vrAggregateFailures;
```
I do not see the logic of the name (also the leading _ can be dropped) It
suggests it contains an aggeregate of failures while it only contains one
failure per VR.
##########
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:
also, it can hold only one failure. Will that do in all circumstances?
--
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]