-
Notifications
You must be signed in to change notification settings - Fork 738
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
Save local connector address in Attach API code #2951
Conversation
} | ||
if (Objects.isNull(addr)) { | ||
/* startLocalAgent() should have set the property. */ | ||
return Response.EXCEPTION_AGENT_INITIALIZATION_EXCEPTION + "loadAgentLibrary: " + LOCAL_CONNECTOR_ADDRESS + " not defined"; //$NON-NLS-1$ //$NON-NLS-2$ |
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.
Needs a space after EXCEPTION_AGENT_INITIALIZATION_EXCEPTION
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 code is the same as that in startLocalAgent()
, correct? If so, please factor it out into a separate static method. While you are doing that, please add logging to record the agent address and any errors.
73756d2
to
8d0dd3f
Compare
try { | ||
saveLocalConnectorAddress(); | ||
} catch (IbmAttachOperationFailedException e) { | ||
return Response.EXCEPTION_AGENT_INITIALIZATION_EXCEPTION + "loadAgentLibrary: " + e.getMessage(); |
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.
Please add a space between EXCEPTION_AGENT_INITIALIZATION_EXCEPTION and "loadAgentLibrary: "
try { | ||
return saveLocalConnectorAddress(); | ||
} catch (IbmAttachOperationFailedException e) { | ||
throw new IbmAttachOperationFailedException("startLocalManagementAgent: " + e.getMessage()); |
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 should set the original exception as the cause of the IbmAttachOperationFailedException. Although see the next comment, I think saveLocalConnectorAddress() could just return null.
IPC.logMessage(LOCAL_CONNECTOR_ADDRESS + " not set"); //$NON-NLS-1$ | ||
throw new IbmAttachOperationFailedException("startLocalManagementAgent: " + LOCAL_CONNECTOR_ADDRESS + " not defined"); //$NON-NLS-1$ //$NON-NLS-2$ | ||
throw new IbmAttachOperationFailedException(LOCAL_CONNECTOR_ADDRESS + " not defined"); //$NON-NLS-1$ |
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.
Does this need to throw an exception? Seems it could just return null.
e97b67a
to
ceb58cb
Compare
jenkins test all zlinux jdk8 |
At least one failure in extended testing
|
VirtualMachine.getAgentProperties() doesn't get the local connector address if it isn't saved to our systems properties. Thus, we check VMSupport class for the local connector address and save it in system properties if it is not there already. Signed-off-by: Mike Zhang <mike.h.zhang@ibm.com>
ceb58cb
to
a0f34a7
Compare
Removed the save local connector code in |
jenkins test extended zlinux jdk8 |
From #2742, VirtualMachine.getAgentProperties() doesn't get the local connector address if it isn't saved to our systems properties. Thus, we check VMSupport class for the local connector address and save it in system properties if it is not there already.
Fixes #2742
Signed-off-by: Mike Zhang mike.h.zhang@ibm.com