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(cancel): cancel during wait stage #1726

Merged
merged 1 commit into from
Oct 20, 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 @@ -18,10 +18,7 @@ package com.netflix.spinnaker.orca.q.handler

import com.netflix.spinnaker.orca.ExecutionStatus.PAUSED
import com.netflix.spinnaker.orca.pipeline.persistence.ExecutionRepository
import com.netflix.spinnaker.orca.q.CancelExecution
import com.netflix.spinnaker.orca.q.MessageHandler
import com.netflix.spinnaker.orca.q.Queue
import com.netflix.spinnaker.orca.q.ResumeStage
import com.netflix.spinnaker.orca.q.*
import org.springframework.stereotype.Component

@Component
Expand All @@ -43,6 +40,9 @@ class CancelExecutionHandler(
.forEach { stage ->
queue.push(ResumeStage(stage))
}

// then, make sure those runTask messages get run right away
queue.push(RescheduleExecution(execution))
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ object CancelExecutionHandlerTest : SubjectSpek<CancelExecutionHandler>({
verify(repository).cancel(pipeline.id, "fzlem@netflix.com", "because")
}

it("it triggers a reevaluate") {
verify(queue).push(RescheduleExecution(pipeline))
}

it("does not send any further messages") {
verifyZeroInteractions(queue)
}
Expand Down