brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aled Sage <aled.s...@gmail.com>
Subject Re: STOP_MACHINE_MODE & IF_NOT_STOPPED
Date Wed, 18 Mar 2015 14:55:55 GMT
Hi Svet,

If we fail to stop the machine (e.g. because it is already stopped), the 
does it continue? Or does it abort reporting failure?

Assuming stop's behaviour is sensible when the machine is not running, 
then your suggestion sounds good to me: to have 
`STOP_MACHINE_MODE=ALWAYS` as the default.

Aled


On 18/03/2015 14:18, Svetoslav Neykov wrote:
> The STOP_MACHINE_MODE stop parameter introduced an unpleasant case where stopping the
entity with STOP_MACHINE_MODE=NEVER and then stopping the parent application would leak the
machine. This was fixed thanks to @nakomis at https://github.com/apache/incubator-brooklyn/pull/553
<https://github.com/apache/incubator-brooklyn/pull/553>.
> The current behaviour of STOP_MACHINE_MODE is identical to the deprecated STOP_MACHINE=true/false,
where StopMode.ALWAYS corresponds to true and StopMode.NEVER corresponds to false. IF_NOT_STOPPED
behaves as ALWAYS (it will shutdown the machine if the machine is not shut down already).
This makes STOP_MACHINE_MODE awkward to use, so any thoughts on should we:
>    * Deprecate STOP_MACHINE_MODE and bring back STOP_MACHINE as the preferred parameter.
>    * Make the default value for STOP_MACHINE_MODE=ALWAYS and revert to the previous behaviour
of IF_NOT_STOPPED, where it would not stop the machine if the entity is already stopped.
>
> I prefer the latter for consistency, though can't give real-world examples where IF_NOT_STOPPED
would be needed.
>
> Historically STOP behaved as if STOP_PROCESS_MODE=IF_NOT_STOPPED, STOP_MACHINE_MODE=IF_NOT_STOPPED,
hence the state was introduced and made default.
>
> If a machine needs to be leaked on purpose, to preserve some state, stop it with STOP_MACHINE_MODE=NEVER
and unmanage the entity.
>
> Svet.


Mime
View raw message