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 <[email protected]>
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 [email protected] or file a JIRA ticket
with INFRA.
---