Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
bugfix/BRBDCF-938-janus-a4c-undeploy-application-with-a4c-does-not-re…
Browse files Browse the repository at this point in the history
…move-purge : fix issue on handling undeployment completion and setting statuses
  • Loading branch information
stefbenoist committed Jan 25, 2018
1 parent d164baf commit 56944ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,13 @@ private boolean retryDeploymentPurge(String paasId) {
retry = true;
}
catch(JanusRestException jre){
log.error("undeployJanus purge returned an exception: " + jre.getMessage());
if (jre.getHttpStatusCode() == 400){
log.warn("Purge will be requested again later because Janus is still undeploying application with deployment id:" + paasId);
retry = true;
}
// 404 status code is ignored for purge failure
else if (jre.getHttpStatusCode() != 404){
log.error("undeployJanus purge returned an exception: " + jre.getMessage());
changeStatus(paasId, DeploymentStatus.FAILURE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,17 @@ public void run() {
}
}

log.debug("Undeploying " + paasId);
log.debug("Undeploying deployment Id:" + paasId);
boolean done = false;
String taskUrl = null;
String status = "UNKNOWN";
String status;
try {
taskUrl = restClient.undeployJanus(deploymentUrl, false);
orchestrator.changeStatus(paasId, DeploymentStatus.UNDEPLOYED);
done = true;
if (taskUrl == null) {
// Assumes already undeployed
orchestrator.changeStatus(paasId, DeploymentStatus.UNDEPLOYED);
done = true;
}
}
catch (JanusRestException jre) {
// Deployment is not found or already undeployed
Expand Down Expand Up @@ -176,5 +179,4 @@ public void run() {
callback.onFailure(error);
}
}

}

0 comments on commit 56944ad

Please sign in to comment.