[OPNFLWPLUG-721] Flows removed from DeviceFlowRegistry after being updated Created: 03/Jul/16  Updated: 27/Sep/21  Resolved: 19/Jul/16

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Josh Hershberg Assignee: Josh Hershberg
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 6145

 Description   

The following code is from SalFlowServiceImpl.updateFlow (and annotated):

//STEP 1: HERE THE FLOW IS MARKED FOR DELETION BUT NOT ACTUALLY DELETED. THE MARK IS BASED ON THE FLOW HASH

deviceFlowRegistry.markToBeremoved(flowRegistryKey);

if (itemLifecycleListener != null) {
final FlowDescriptor flowDescriptor = deviceContext.getDeviceFlowRegistry().retrieveIdForFlow(flowRegistryKey);
if (flowDescriptor != null)

{ KeyedInstanceIdentifier<Flow, FlowKey> flowPath = createFlowPath(flowDescriptor, deviceContext.getDeviceInfo().getNodeInstanceIdentifier()); itemLifecycleListener.onRemoved(flowPath); }

}
//if provided, store flow id to flow registry
if (flowRef != null) {
final FlowId flowId = flowRef.getValue().firstKeyOf(Flow.class, FlowKey.class).getId();
final FlowDescriptor flowDescriptor = FlowDescriptorFactory.create(updated.getTableId(), flowId);

STEP 2: HERE THE FLOW IS RE-ADDED...
deviceFlowRegistry.store(updatedflowRegistryKey, flowDescriptor);

STEP 3: STEP 3: DeviceFlowRegistryImpl.removeMarked is called resulting in the removing of a flow that should not be removed because it was in fact re-added right afterwards. Next time the flow is updated via an OFPST_FLOW it is missing the flow id and therefor receives a generated "alien" id.



 Comments   
Comment by Josh Hershberg [ 03/Jul/16 ]

Note: STEP 3 happens in another thread and after some time.

Comment by Josh Hershberg [ 06/Jul/16 ]

Hey. I already submitted a fix for this. Sorry, I forgot to assign it to me:
https://git.opendaylight.org/gerrit/#/c/41247/

Comment by Andrej Leitner [ 19/Jul/16 ]

closing bug, since the patch was merged on master week ago

Generated at Wed Feb 07 20:33:13 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.