brooklyncentral / brooklyn

This project has moved and is now part of the ASF
https://github.com/apache/incubator-brooklyn
71 stars 27 forks source link

jboss as7 deploy/undeploy returns before completed #277

Open aledsage opened 12 years ago

aledsage commented 12 years ago

When using jboss AS7 entity (or tomcat or as6), when you deploy or undeploy an artifact the effector returns as soon as the file has been copied. The web-app will not be available until some time after that, or the deployment may subsequently fail in the app-server without the brooklyn entity reporting this at all.

This is a particular problem for things like scaling a cluster. The load-balancer (e.g. nginx) will be updated to route requests to the new app-server, but this does not guarantee that the app-server has installed the required initial wars. It looks like this is a cause of failed http requests when scaling out a cluster.


The start-up should block until the initial wars have been deployed. And the deploy/undeploy effectors should block until the app-server really has finished the operation for the web-app.

aledsage commented 12 years ago

For AS7, I suggest we use the jboss-cli.sh to deploy and undeploy, rather than just adding/removing from the deployments dir. This is the recommendation in the admin guide:

https://docs.jboss.org/author/display/AS7/Admin+Guide#AdminGuide-DeploymentCommands
Users, particularly those running production systems, are encouraged to use the JBoss AS 7 
management APIs to upload and deploy deployment content instead of relying on the deployment 
scanner subsystem that periodically scans this directory.
aledsage commented 12 years ago

This is also an issue with Tomcat and AS6, but the solution for each of those will presumably look quite different.

ahgittin commented 12 years ago

jboss to use CLI is a good improvement. i wonder if it blocks until complete...

as for the races, on start/deploy:

And on stop:

and either:

again delay might be the pragmatic option