Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(canary): fix cleanup of unhealthy canaries with multiple clusters #1749

Merged
merged 2 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class WaitTask implements RetryableTask {

@Override
TaskResult execute(Stage stage) {
if (stage.context.waitTime == null) {
return new TaskResult(SUCCEEDED)
}
// wait time is specified in seconds
long waitTime = stage.context.waitTime as long
def waitTimeMs = TimeUnit.MILLISECONDS.convert(waitTime, TimeUnit.SECONDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ class DisableCanaryTask extends AbstractCloudProviderAwareTask implements Task {

try {
def canary = mineService.getCanary(stage.context.canary.id)
if (canary.health?.health == 'UNHEALTHY') {
if (canary.health?.health == 'UNHEALTHY' || stage.context.unhealthy != null) {
// If unhealthy, already disabled in MonitorCanaryTask
return TaskResult.SUCCEEDED
return new TaskResult(ExecutionStatus.SUCCEEDED, [
waitTime : waitTime,
unhealthy : true
])
}
} catch (RetrofitError e) {
log.error("Exception occurred while getting canary status with id {} from mine, continuing with disable",
Expand Down