Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1E60F200BC8 for ; Wed, 23 Nov 2016 08:13:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1D089160AFD; Wed, 23 Nov 2016 07:13:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8C25B160AFA for ; Wed, 23 Nov 2016 08:13:46 +0100 (CET) Received: (qmail 49754 invoked by uid 500); 23 Nov 2016 07:13:45 -0000 Mailing-List: contact dev-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list dev@brooklyn.apache.org Received: (qmail 49738 invoked by uid 99); 23 Nov 2016 07:13:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2016 07:13:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 19B3FE0158; Wed, 23 Nov 2016 07:13:45 +0000 (UTC) From: neykov To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-server issue #454: LocalEntityManager: make fields private Content-Type: text/plain Message-Id: <20161123071345.19B3FE0158@git1-us-west.apache.org> Date: Wed, 23 Nov 2016 07:13:45 +0000 (UTC) archived-at: Wed, 23 Nov 2016 07:13:47 -0000 Github user neykov commented on the issue: https://github.com/apache/brooklyn-server/pull/454 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---