[VOL-4045] Fix some race conditions in rw-core
This commit addresses only the race conditions seen during
testing.
Change-Id: I59859a5222c892453f3c089a181d4290e18f1863
diff --git a/rw_core/core/device/agent_device_update.go b/rw_core/core/device/agent_device_update.go
index 9e5013a..621e720 100644
--- a/rw_core/core/device/agent_device_update.go
+++ b/rw_core/core/device/agent_device_update.go
@@ -39,9 +39,8 @@
}
func (agent *Agent) stateChangeString(prevState *common.AdminState_Types, currState *common.AdminState_Types) string {
- device := agent.getDeviceReadOnlyWithoutLock()
if prevState != nil && currState != nil && *prevState != *currState {
- return fmt.Sprintf("%s->%s", *prevState, device.AdminState)
+ return fmt.Sprintf("%s->%s", *prevState, *currState)
}
return ""
}