Revert "Copy FlowOperationsProcessor defensively for thread safety"
This reverts commit f752afc1cf0b850e930d146cac67aac8943cc82a.
This reverts could reduce the risk of ONOS-5271.
Change-Id: I32817403ef803dcf6adfbb98f99f8724ca7575d7
diff --git a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
index b386df4..50d74fc 100644
--- a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
@@ -603,20 +603,12 @@
// Mutable
private final List<Set<FlowRuleOperation>> stages;
- private final Set<DeviceId> pendingDevices;
+ private final Set<DeviceId> pendingDevices = new HashSet<>();
private boolean hasFailed = false;
FlowOperationsProcessor(FlowRuleOperations ops) {
this.stages = Lists.newArrayList(ops.stages());
this.fops = ops;
- this.pendingDevices = new HashSet<>();
- }
-
- FlowOperationsProcessor(FlowOperationsProcessor src) {
- this.fops = src.fops;
- this.stages = Lists.newArrayList(src.stages);
- this.pendingDevices = new HashSet<>(src.pendingDevices);
- this.hasFailed = src.hasFailed;
}
@Override
@@ -649,7 +641,7 @@
synchronized void satisfy(DeviceId devId) {
pendingDevices.remove(devId);
if (pendingDevices.isEmpty()) {
- operationsService.execute(new FlowOperationsProcessor(this));
+ operationsService.execute(this);
}
}
@@ -657,7 +649,7 @@
hasFailed = true;
pendingDevices.remove(devId);
if (pendingDevices.isEmpty()) {
- operationsService.execute(new FlowOperationsProcessor(this));
+ operationsService.execute(this);
}
FlowRuleOperations.Builder failedOpsBuilder = FlowRuleOperations.builder();