-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve app state checking and fix deployment issues #21
Improve app state checking and fix deployment issues #21
Conversation
I've used |
Add logging to deployment/undeployment to help debug occasional deployment issues.
Fixes OpenLiberty#18 where the container very briefly sees the app in INSTALLED state before liberty begins starting it and assumes that it has failed to start. Also did some refactoring and cleanup of the application state checking code.
Fixes OpenLiberty#16 by ensuring the apps and dropins directories are created if they're needed. Fixes OpenLiberty#18 by exporting the app to a temporary location and then moving it into the dropins directory.
ac4186b
to
4776c49
Compare
Did a few more liberty builds with these changes and I'm pretty convinced that it fixes the issues we've been seeing. It's ready to be reviewed and merged. |
@@ -398,6 +387,9 @@ public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentExcept | |||
try { | |||
// If the deployment is to server.xml, then update server.xml with the application information | |||
if (containerConfiguration.isDeployTypeXML()) { | |||
if (log.isLoggable(FINER)) { | |||
log.finer("Deploying using server.xml"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is OK but I might have included the archiveName in the log msg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think having the archive name here is necessary as it'll be included with the archive details (logged at the same level on line 376)
appMessageStatus.append("Timeout while waiting for \"") | ||
.append(appStateChecker.getAppName()) | ||
.append("\" ApplicationMBean to reach ") | ||
.append(desiredState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see where it logs the actual state (what used to be "status") at the error level or in then exception. It is logged as currentState in line 951 but at a logging level that is less likely to be operative when an unexpected problem occurs?? [Unless one thinks of Arquillian being used for test only and thus mostly at high log levels???)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I'll add that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments only. Overall a good improvement IMHO.
Short description of what this resolves:
Avoid the case where the container sees the app in
INSTALLED
state and assumes that it has failed to start when actually liberty hasn't attempted to start it yet.Avoid the case where liberty tries to start an application deployed to
dropins
before the container has finished writing it.Create the
apps
anddropins
directories if they do not exist and are required.Changes proposed in this pull request:
INSTALLED
state for 1 second (this should be plenty of time, usually it moves fromINSTALLED
toSTARTING
so quickly that the container doesn't even see it.apps
ordropins
directories, create them if they don't exist.Fixes: #18 #16