[ 
https://issues.apache.org/jira/browse/BROOKLYN-322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15405916#comment-15405916
 ] 

ASF GitHub Bot commented on BROOKLYN-322:
-----------------------------------------

GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/286

    BROOKLYN-322: feeds don’t poll if entity unmanaged

    Fixes https://issues.apache.org/jira/browse/BROOKLYN-322. See the 
description in that jira issue.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server brooklyn-322

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/286.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 #286
    
----
commit 952f017b36f86017dd42aa99f0c9f91ea6443e21
Author: Aled Sage <[email protected]>
Date:   2016-08-03T13:26:06Z

    code tidy: SoftwareProcess tests

commit ac155de48e4871e3f33f15881576c2526c11705c
Author: Aled Sage <[email protected]>
Date:   2016-08-03T13:26:38Z

    BROOKLYN-322: feeds don’t poll if entity unmanaged

----


> On rebind, entity temporarily (incorrectly) reports serviceUp=false
> -------------------------------------------------------------------
>
>                 Key: BROOKLYN-322
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-322
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Aled Sage
>
> With Brooklyn 0.10.0-SNAPSHOT (but also with older versions, I presume)...
> When rebinding to many entities, some software processes temporarily show 
> serviceUp=false before going back to showing the correct serviceUp=true.
> The problem is with the polling of their feeds. It starts polling 
> immediately, rather than waiting for the entity to be managed. This can cause 
> some feeds to throw an exception (e.g. when 
> {{SoftwareProcessImpl.connectServiceUpIsRunning}} calls 
> {{driver.isRunning()}}, and that tries to execute an ssh command). The 
> exception causes the feed to set it to whatever value the {{onException}} 
> tells it to use.
> It is more likely to happen when there are many entities, because the 
> entities will be unmanaged for longer.
> The solution is to not poll when the entity is not managed.
> This is a simple fix in ((Poller}}.
> It might cause problems for those trying to use a Poller to poll just once: 
> it might skip that single poll because the entity is unmanaged. I think we 
> can ignore that. I don't know of any use-cases doing that. Also, I suspect 
> that it might be a good thing! On rebind we don't necessarily want to do that 
> single poll again, and when the feed is first registered we'd hope that it is 
> done when the entity is managed (if done in 
> {{SoftwareProcess.connectSensors()}}, but not if done in the entity's init 
> method).
> We could revisit this in the future, so that if the entity is unmanaged (but 
> e think it will soon be managed), then we reschedule it for when the entity 
> is actually managed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to