diff --git a/nucleus/change.go b/nucleus/change.go index 729e1ced410f6f9822c23317c2949c248ae8208a..8dd585cd9ef627fa7162f2f84760489cf5b5393e 100644 --- a/nucleus/change.go +++ b/nucleus/change.go @@ -141,7 +141,15 @@ func stateManager(ch *Change, timeout time.Duration) (chan<- ppb.Change_State, < if ch.state == ppb.Change_CONFIRMED { continue } - err := ch.callback(ch.intendedState, ch.previousState) + + //TODO: debug -> remove + ch.lock.Lock() + intendedStateCopy := ch.intendedState + previousStateStateCopy := ch.previousState + ch.lock.Unlock() + // END + + err := ch.callback(intendedStateCopy, previousStateStateCopy) if err != nil { ch.lock.Lock() ch.state = ppb.Change_INCONSISTENT