Skip to content

Commit

Permalink
Refactor AbstractDockerAdapterService.getContainerHost for debugging …
Browse files Browse the repository at this point in the history
…purposes

Refactor AbstractDockerAdapterService.getContainerHost to isolate sporadic
exceptions observed in sendRequest.

Change-Id: Ie1e8dc5411efafa041f3b6f0bc4b1bcff7e08892
Reviewed-on: http://bellevue-ci.eng.vmware.com:8080/10728
Reviewed-by: Sergio Sanchez <[email protected]>
Bellevue-Verified: e_vcoauto_glob_1 <[email protected]>
Closures-Verified: e_vcoauto_glob_1 <[email protected]>
Compute-Verified: e_vcoauto_glob_1 <[email protected]>
CS-Verified: e_vcoauto_glob_1 <[email protected]>
Upgrade-Verified: e_vcoauto_glob_1 <[email protected]>
  • Loading branch information
jdillet committed May 26, 2017
1 parent d87cc00 commit 993e025
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ protected void getContainerHost(AdapterRequest request, Operation op,
}
fail(request, ex);
} else {
ComputeState hostComputeState = o.getBody(ComputeState.class);
if (!hostComputeState.documentSelfLink
.startsWith(ComputeService.FACTORY_LINK)) {
getHost().log(Level.SEVERE,
"***** Wrong ComputeState returned: request: %s, response link: %s, json: %s",
containerHostReference, hostComputeState.documentSelfLink,
Utils.toJson(hostComputeState));
}
handleExceptions(request, op, () -> {
ComputeState hostComputeState = o.getBody(ComputeState.class);
if (!hostComputeState.documentSelfLink
.startsWith(ComputeService.FACTORY_LINK)) {
getHost().log(Level.SEVERE,
"***** Wrong ComputeState returned: request: %s, response: %s",
containerHostReference,
hostComputeState.documentSelfLink);
}
createHostConnection(request, op, hostComputeState, callbackFunction);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private void processContainerState(RequestContext context) {
getContainerHost(
context.request,
context.operation,
context.request.resolve(context.containerState.parentLink),
UriUtils.buildUri(getHost(), context.containerState.parentLink),
(computeState, commandInput) -> {
context.commandInput = commandInput;
context.executor = getCommandExecutor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,8 @@ public static URI getDockerHostUri(ComputeState hostComputeState) {
// debugging dockerHostAddress is null issue
if (dockerHostAddress == null) {
Logger.getLogger(ContainerDescription.class.getName()).log(Level.INFO,
String.format(
"dockerHostAddress for host %s is null, version: %d, description: %s, creationTime: %d, id: %s, powerState: %s, customProperties: %s",
hostComputeState.documentSelfLink, hostComputeState.documentVersion,
hostComputeState.descriptionLink,
hostComputeState.creationTimeMicros, hostComputeState.id,
hostComputeState.powerState, hostComputeState.customProperties));
String.format("dockerHostAddress for host %s is null: %s",
hostComputeState.documentSelfLink, Utils.toJson(hostComputeState)));
}
AssertUtil.assertNotNull(dockerHostAddress, "address");

Expand Down

0 comments on commit 993e025

Please sign in to comment.