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 E63A9200BC5 for ; Tue, 22 Nov 2016 11:20:21 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E4F59160B0C; Tue, 22 Nov 2016 10:20:21 +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 3B90B160B0A for ; Tue, 22 Nov 2016 11:20:21 +0100 (CET) Received: (qmail 21694 invoked by uid 500); 22 Nov 2016 10:20:20 -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 21678 invoked by uid 99); 22 Nov 2016 10:20:19 -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; Tue, 22 Nov 2016 10:20:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8BE0FDFF75; Tue, 22 Nov 2016 10:20:19 +0000 (UTC) From: neykov To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org Message-ID: Subject: [GitHub] brooklyn-server pull request #452: Fix out of order events triggered by Comp... Content-Type: text/plain Date: Tue, 22 Nov 2016 10:20:19 +0000 (UTC) archived-at: Tue, 22 Nov 2016 10:20:22 -0000 GitHub user neykov opened a pull request: https://github.com/apache/brooklyn-server/pull/452 Fix out of order events triggered by ComputeServiceState `ComputeServiceState.onEvent` should only be called in the event handler executor to keep the ordering of events. Before the change what would happen is on calling `setExpectedState(state)` a "state.expected" event would be scheduled, with `ComputeServiceState.onEvent(null)` called in the same thread right after. This would create a race condition when calling `setExpectedState` in quick succession (`onEvent` called from the `setExpectedState` thread and from the event handler thread with different values). You can merge this pull request into a Git repository by running: $ git pull https://github.com/neykov/brooklyn-server fix/compute-service-concurrency Alternatively you can review and apply these changes as the patch at: https://github.com/apache/brooklyn-server/pull/452.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #452 ---- commit fed1e729ca53f4fe120951870eba7a46625acb0e Author: Svetoslav Neykov Date: 2016-11-22T10:18:54Z Fix out of order events triggered by ComputeServiceState ComputeServiceState.onEvent should only be called in the event handler executor to keep the ordering of events. Before the change what would happen is on calling setExpectedState(state) a "state.expected" event would be scheduled, with ComputeServiceState.onEvent(null) called in the same thread right after. This would create a race condition when calling setExpectedState in quick succession (onEvent called from the setExpectedState thread and from the event handler thread with different values). ---- --- 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. ---