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-
> nicira-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.NxAugMatchNodesNodeTableFlow=
> NxAugMatchNodesNodeTableFlow{getNxmNxNsp=NxmNxNsp{getValue=300,
> augmentations={}}}}}, getExtensionKey=class org.opendaylight.yang.gen.v1.
> urn.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.urn.opendaylight.
> openflowplugin.extension.nicira.match.rev140714.NxmNxNspKey],
> augmentation=[]]]]* hashcode : -1428243401*
>
> 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
>
>
_______________________________________________
openflowplugin-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/openflowplugin-dev

Reply via email to