-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CODENVY-1407: Log agent output on fail #3961
Conversation
Signed-off-by: Mykola Morhun <[email protected]>
Signed-off-by: Mykola Morhun <[email protected]>
@Override | ||
public void launch(Instance machine, Agent agent) throws ServerException { | ||
if (isNullOrEmpty(agent.getScript())) { | ||
return; | ||
} | ||
ListLineConsumer agentLogger = new ListLineConsumer(); | ||
LineConsumer lineConsumer = new AbstractLineConsumer() { |
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.
CompositeLineConsumer?
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.
Possible, but in that case we shouldn't close CompositeLineConsumer
, only agentLogger
(which is part of composite consumer).
Can you show an example of output if ssh connection fails? |
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/1824/ |
* the agent to start | ||
* @throws ServerException | ||
* if script execution failed | ||
*/ |
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.
Doc should be moved to interface.
/** | ||
* Launches agent script in machine and waits until agent starts. | ||
* The machine should be started. | ||
* Retrieves agent's logs if its start fails. |
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.
As far as I can see it logs agent logs if it fails, but stores it in any case. Is it needed to add logging related logic into javadocs?
Signed-off-by: Mykola Morhun <[email protected]>
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'm not big fan of putting agents logs into memory and into logs, but ok with that if we need it.
@tolusha Please take a look
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/1834/ |
CODENVY-1407: Log agent output on fail
What does this PR do?
Logs agent output if it fails to start.
What issues does this PR fix or reference?
codenvy/codenvy#1407
Changelog
Add output of failed agent into tomcat logs.
Release Notes
N/A
Docs PR
N/A