brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <>
Subject [GitHub] brooklyn-server issue #454: LocalEntityManager: make fields private
Date Wed, 23 Nov 2016 07:13:45 GMT
Github user neykov commented on the issue:
    So that's the reason why `onEvent` was called explicitly - to give callers of `setExpectedState`
synchronous control over `state.actual`. Otherwise the change from `config().set(STATE_ACTUAL)`
to `setExpectedState` would've been a disaster will the code all over making the synchronous
assumption. Now it makes sense.
    >I wonder if child is still reporting starting for a few extra milliseconds (set async)
because of not doing onEvent(null)
    That's the case. This child (`TestSensor`) is manipulating the state by calling `setExpectedState`
which sets `state.actual` async so it will be evaluated **after** start completes.
    Even if we fix `TestSensor` there are a ton of places assuming `state.actual` has been
set synchronously. I think the right thing to do is wait in `setExpectedState` for the to-be
fired event to be handled. Wonder could this lead to deadlocks.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message