fix(cf): reduce results per page requests to lower timeout frequency
spinnaker/spinnaker#5286
MODIFY
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/Applications.java
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/Applications.java
@@ -95,7 +95,7 @@ public class Applications {
public List<CloudFoundryApplication> all() {
List<Application> newCloudFoundryAppList =
- collectPages("applications", page -> api.all(page, 5000, null, null));
+ collectPages("applications", page -> api.all(page, 500, null, null));
// Evict Records from `cache` that are no longer in the foundation
List<String> availableAppIds =

MODIFY
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/CloudFoundryApiException.java
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/CloudFoundryApiException.java
@@ -76,6 +76,6 @@ public class CloudFoundryApiException extends RuntimeException {
+ ". raw response body: "
+ response.getBody();
})
- .orElse("error, url :" + retrofitError.getUrl() + " body: " + retrofitError.getBody());
+ .orElse("error, url :" + retrofitError.getUrl() + " cause: " + retrofitError.getCause());
}
}

MODIFY
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/Routes.java
clouddriver-cloudfoundry/src/main/java/com/netflix/spinnaker/clouddriver/cloudfoundry/client/Routes.java
@@ -59,7 +59,7 @@ public class Routes {
private LoadingCache<String, List<RouteMapping>> routeMappings =
CacheBuilder.newBuilder()
- .expireAfterWrite(30, TimeUnit.SECONDS)
+ .expireAfterWrite(3, TimeUnit.MINUTES)
.build(
new CacheLoader<String, List<RouteMapping>>() {
@Override
@@ -143,7 +143,7 @@ public class Routes {
public List<CloudFoundryLoadBalancer> all() throws CloudFoundryApiException {
List<Resource<Route>> routeResources =
- collectPageResources("routes", pg -> api.all(pg, 5000, null));
+ collectPageResources("routes", pg -> api.all(pg, 500, null));
List<CloudFoundryLoadBalancer> loadBalancers = new ArrayList<>(routeResources.size());
for (Resource<Route> routeResource : routeResources) {
loadBalancers.add(map(routeResource));

fix(cf): reduce results per page requests to lower timeout frequency (#4271)

spinnaker/spinnaker#5286