Handle cancel txn exception for slaves and device disconnect exception 79/28979/4
authorKamal Rameshan <kramesha@cisco.com>
Mon, 5 Oct 2015 05:16:17 +0000 (22:16 -0700)
committerKamal Rameshan <kramesha@cisco.com>
Wed, 11 Nov 2015 21:20:54 +0000 (13:20 -0800)
commit2e61b82e5e1d7bc7f153b3fa3ff5dd346990e204
treebbd7329e50bc471b856d854860e7665f20c3ec57
parent42da3e7183869d6f32df7f31da33cfc4b2205917
Handle cancel txn exception for slaves and device disconnect exception

During the device initialization process, if its encountered that the role for this node is slave
we cancel the txn which is built during the process.
Now since ping-pong txn does not have a cancel, we drop the txn and recreate it. This throws an exception
Since this is an expected exception, it would be advisable to catch and log it in debug.

Also when a node gets disconected from device, the EntityOwnershipService does send a notification. Which trigers a role change.
A check is made to check if the device is connected before moving ahead with the role change.

Change-Id: I76572f27274f5c5f08117fcfd1590d1042049735
Signed-off-by: Kamal Rameshan <kramesha@cisco.com>
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/role/RoleContextImplTest.java