Start operation semantics for AS - Request for Feedback
Jay Shaughnessy
jshaughn at redhat.com
Wed May 2 16:43:31 UTC 2012
The AS5 and AS7 plugins have enhanced their support for the Start
operation by better recreating the environment the server was discovered
in. It does this by adding two new connection props, startScriptEnv and
startScriptArgs. StartScriptEnv provides the environment variables, and
startScriptArgs provides the script arguments, to be applied to the
start script executing in response to the resource operation.
AS5 and AS7 have discovery code in place to populate these new
properties with the environment running at discovery time.
(Additionally, there is discovery support for custom script names.) In
this way the Start operation better reproduces the environment of the
AS. Previously, only the Configuration and Bind Address were
discovered and used in the Start operation and this was not sufficient.
These new properties are editable, allowing the user to add, change,
remove environment variables and/or script args as necessary. Or, in
the case of AS5 legacy resources, add initial values if desired because
they will be empty after upgrade.
The changes are good but introduce some subtlety in semantics.
Currently things work as follows:
If startScriptEnv is unset then the start script defaults to the RHQ
agent's environment. Note, this is not a union. If any startScriptEnv
values are specified then those will be the only environment variables
applied to the environment. This makes the run environment
deterministic. The discovery code is designed to provide only the
required subset for the standard AS start scripts.
Note that if startScriptEnv is unset, JAVA_HOME as set in the connection
property will override the Agent's setting. This property is also used
for the Shutdown operation.
If startScriptArgs is unset, then the start script defaults to the
legacy behavior and applies the Configuration and Bind Address
discovered in the individual connection props. This is also not a
union. If any startScriptArgs are specified then those will be the only
script args applied. The discovery code is designed to try and discover
all of the originally supplied script args.
One question is whether the current behavior is correct when and if the
Configuration or Bind Address connection properties are edited or, for
any other reason, don't match the settings in startScriptArgs. As
stated above, those property values are ignored of startScriptArgs is
set. Meaning, the value in startScriptArgs will supersede any setting
for the individual properties.
My feeling is that this is OK, it's possible those script args will even
apply if the customer is using a custom script. The property
descriptions could be updated to make clear that the value is overridden
if startScriptArgs is set. Additionally, the behavior can be formally
documented and referenced in the release notes.
If you have an opinion on any of the above semantics please let us know
so the new feature can be finalized. Thanks, Jay and Ian.
More information about the rhq-devel
mailing list