I tried with equals, but didn't help. On Wed, Oct 25, 2017 at 2:35 PM, Anil Vishnoi <[email protected]> wrote:
> Currently we maintain the object in the hashmap and once flow comes back > from switch we check in that hashmap, so it's just hashcode based check. I > tried by iterating through the hashmap and using equal to check the > equality, but that didn't work as well. Let me try it again to make sure of > it. > > On Wed, Oct 25, 2017 at 1:58 PM, Tom Pantelis <[email protected]> > wrote: > >> Anil, >> >> Does the equals method work correctly? Are you using just the hashCode to >> determine equality? >> >> Tom >> >> On Wed, Oct 25, 2017 at 4:27 PM, Anil Vishnoi <[email protected]> >> wrote: >> >>> Hi mdsal-devs, >>> >>> I was debugging the blocker bug OPNFLWPLUG-930, and looks like this >>> issue is happening because of the different hashcode generated by >>> LazilyCreated object (data change notification data) and through builder >>> objects. I updated the details on the bug, and here is the relevant >>> snippet >>> >>> ============== >>> it's an issue related to object hashcode values for the augmentations. >>> To me it looks like this issue will happen for any augmentation on match. >>> In am able to recreate it by augmenting single extension on the flow match >>> >>> "match": { >>> "openflowplugin-extension-general:extension-list": [ >>> { >>> "extension": { >>> "openflowplugin-extension-nicira-match:nxm-nx-nsp": { >>> "value": 300 >>> } >>> }, >>> "extension-key": "openflowplugin-extension-nici >>> ra-match:nxm-nx-nsp-key" >>> } >>> ] >>> }, >>> >>> Plugin receives the data change notification when user write flow to >>> data store and uses that data change notification data to generate the flow >>> body (match, instruction) and dump it to switch. And looks like the >>> notifications data is populated lazily and and plugin call the hashcode on >>> Match object ( augmented with the extension) it return different hashcode >>> value, compared to the object build through the normal builder object. >>> >>> Augmentation on Match object created using the data change notification >>> data >>> >>> 2017-10-25 12:51:06,532 | INFO | on-dispatcher-43 | >>> FlowRegistryKeyFactory | 285 - >>> org.opendaylight.openflowplugin.impl >>> - 0.5.1.SNAPSHOT | Augmentation : GeneralAugMatchNodesNodeTableF >>> low{getExtensionList=[ExtensionList{getExtension=Extension{augmentations={interface >>> org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin >>> .extension.nicira.match.rev140714.NxAugMatchNodesNodeTableFl >>> ow=NxAugMatchNodesNodeTableFlow{getNxmNxNsp=NxmNxNsp{getValue=300, >>> augmentations={}}}}}, getExtensionKey=class org.opendaylight.yang.gen.v1.u >>> rn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNspKey, >>> augmentations={}}]} *hashcode : -745547690 >>> * >>> >>> Augmentation on Match created through builders provided by java bindings >>> >>> 2017-10-25 12:51:09,241 | INFO | entLoopGroup-7-1 | >>> FlowRegistryKeyFactory | 285 - >>> org.opendaylight.openflowplugin.impl >>> - 0.5.1.SNAPSHOT | Augmentation : GeneralAugMatchNodesNodeTableFlow >>> [_extensionList=[ExtensionList [_extension=Extension >>> [augmentation=[NxAugMatchNotifUpdateFlowStats [_nxmNxNsp=NxmNxNsp >>> [_value=300, augmentation=[]], ]]], _extensionKey=class >>> org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin >>> .extension.nicira.match.rev140714.NxmNxNspKey, _key=ExtensionListKey >>> [_extensionKey=class org.opendaylight.yang.gen.v1.u >>> rn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxNspKey], >>> augmentation=[]]]]* hashcode : -1428243401 <01428%20243%20401>* >>> >>> It's a same augmentation with the same values, but we see different >>> hashcode value when it comes from data store and through builder object, >>> and that's where plugin thinks it's not a match and store it as a alien >>> flow. >>> >>> ====================================== >>> >>> In my opinion it's a bug, but if this is an expected behavior than it >>> kind of defeats the purpose of augmentation for openflowplugin because it >>> won't be able to provide full support to allow external vendors to support >>> extension, because it's all based on augmentation. >>> >>> Please let me know if you need more details to understand the issue. >>> >>> >>> *.* https://jira.opendaylight.org/browse/OPNFLWPLUG-930 >>> >>> -- >>> Thanks >>> Anil >>> >>> _______________________________________________ >>> yangtools-dev mailing list >>> [email protected] >>> https://lists.opendaylight.org/mailman/listinfo/yangtools-dev >>> >>> >> > > > -- > Thanks > Anil > -- Thanks Anil
_______________________________________________ openflowplugin-dev mailing list [email protected] https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev
