Skip to content

Commit

Permalink
Check for status code 404 instead of ServiceNotFoundException in disc…
Browse files Browse the repository at this point in the history
…overed volumes

Performance job is broken because of this, as apparently in cluster get returns
ProtocolException instead of ServiceNotFoundException when a document is not
found.

Change-Id: I5cbe858934994670cd88a80a2e9e98d0df89217b
Reviewed-on: http://bellevue-ci.eng.vmware.com:8080/22814
Reviewed-by: Aleksandar Angelov <[email protected]>
Upgrade-Verified: jenkins <[email protected]>
Closures-Verified: jenkins <[email protected]>
Bellevue-Verified: jenkins <[email protected]>
CS-Verified: jenkins <[email protected]>
  • Loading branch information
jdillet committed Dec 6, 2017
1 parent c6c9f2c commit 849a01d
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import com.vmware.xenon.common.Operation;
import com.vmware.xenon.common.ServiceDocument;
import com.vmware.xenon.common.ServiceDocumentDescription.PropertyIndexingOption;
import com.vmware.xenon.common.ServiceHost.ServiceNotFoundException;
import com.vmware.xenon.common.StatefulService;
import com.vmware.xenon.common.TaskState;
import com.vmware.xenon.common.TaskState.TaskStage;
Expand Down Expand Up @@ -430,15 +429,15 @@ private void createDiscoveredContainerVolumes(List<ContainerVolumeState> volumeS
.createGet(this, possibleVolumeSelfLink)
.setCompletion(
(o, ex) -> {
if (ex != null ) {
if (ex instanceof ServiceNotFoundException) {
createDiscoveredContainerVolume(callback, counter,
volumeState);
} else {
logSevere("Failed to get volume %s : %s",
volumeState.name, ex.getMessage());
counter.getAndDecrement();
}
if (o.getStatusCode() == Operation.STATUS_CODE_NOT_FOUND) {
createDiscoveredContainerVolume(callback, counter,
volumeState);
return;
}
if (ex != null) {
logSevere("Failed to get volume %s : %s", volumeState.name,
ex.getMessage());
counter.getAndDecrement();
} else if (counter.decrementAndGet() == 0) {
callback.accept(null);
}
Expand Down

0 comments on commit 849a01d

Please sign in to comment.