Skip to content

Commit

Permalink
fix(retries): Catch unchecked io exception. (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Duftler authored and Michael Graff committed Nov 16, 2017
1 parent 96fee55 commit df7afe2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -72,11 +73,12 @@ public List<String> processQuery(String metricsAccountName,
registry.counter(queryId.withTag("retries", retries + "")).increment();
metricSetList = metricsService.queryMetrics(metricsAccountName, canaryMetricConfig, canaryScope);
success = true;
} catch (IOException e) {
} catch (IOException|UncheckedIOException e) {
retries++;
// TODO: Externalize this as a configurable setting.
if (retries >= 10)
throw e;
log.warn("Retrying atlas query");
log.warn("Retrying metric service query");
}
}
String metricSetListId = UUID.randomUUID() + "";
Expand Down

0 comments on commit df7afe2

Please sign in to comment.