Description of problem: With the introduction of the handover tasks in deployment-unit, there is now the possibility of a cli script taking long enough to execute that the archive is deployed before the script is complete. If the archive is dependent on said script, then the deployment will fail (for example, if the script is setting up datasources for the deployment). Version-Release number of selected component (if applicable): JBoss ON 3.3 How reproducible: Very Steps to Reproduce: 1. Deploy bundle utilizing handover tasks like in the below excerpt. The script should set up resources that the ear/war is dependent upon and needs to be slow performing enough to still be executing when the deployment starts. <rhq:file name="mq_template.cli" replace="false"> <rhq:handover action="execute-script" failonerror="false" /> </rhq:file> <rhq:archive name="MQTestEar.ear"> <rhq:handover action="deployment" /> </rhq:archive> Actual results: Application deployment fails. Expected results: Application deployment succeeds. Additional info:
Fixed in master branch: master link: https://github.com/rhq-project/rhq/commit/abe2aa7e1 time: 2015-09-29 14:27:06 +0200 commit: abe2aa7e19dd9d10e001f95be6954e438cb25b68 author: Libor Zoubek - lzoubek message: Bug 1252930 - rhq:deployment unit should allow control tasks or execute serially Fix AS7 plugin's handling bundle:handover action="deployment" to ensure server is up before uploading new content. We check for server response for (by default) 120s, this timeout can be changed by setting up as7.plugin.handover-deployment.server-check-timeout.seconds system property (setting to 0 disables this check). Changing component to EAP6 Plugin and resetting Target Release for inclusion in next plugin-pack release.
User suggests that the BundleHandoverRequest "deployment" action's timeout be exposed as a BundleHandoverRequest parameter. This will allow the timeout to be set/overridden in the recipe. The default seems reasonable but it is important to note that even within EAP 6, many custom deployments may delay the start of some services for several minutes. Although this is not the normal scenario, it is common enough to warrant an easier method of overriding this per instance/bundle rather then generically. Is this possible? The parameter must be optional and if not specified, the proper default is used.
In addition to the previous commit, add this one from master. Allows to define additional parameter for the handover deployment. <rhq:handover action="deployment"> <rhq:handover-param name="waitForServer" value="1000" /> </rhq:handover> This overrides defaults and the previous 'new default' that is configurable by the user. commit 508938d591a4614895316bbc07d22f1392a0ea11 Author: Michael Burman <miburman> Date: Tue Jan 19 17:08:30 2016 +0200 [BZ 1252930] Add handover-param to allow changing the configured timeout parameter for server reload
In addition to the previous commits, add this one from master. commit 97a874223ea2a3430cedea2a9b66cd67a22bf4df Author: Josejulio Martínez <jmartine> Date: Fri Jan 22 12:36:53 2016 -0600 BZ-1252930 Changed Math.min to Math.max, so the wait time will be at least one second.
Verified on JON 3.3.5 with eap plugin pack update02 Verified that deployment does not fail earlier than defined in rhq:handover-param name="waitForServer" or default value (120s) when waitForServer is not set. Also verified that deployment is successfully finished when condition causing problems (e.g. server not yet started) are resolved.
This fix/change was released in Application Platform Management Plug-in Pack Update-02 for JBoss ON 3.3.