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(logging): Propagate logging context to cancellation #3819

Merged
merged 2 commits into from
Jul 16, 2020
Merged
Changes from 1 commit
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 @@ -28,6 +28,7 @@ import com.netflix.spinnaker.orca.q.CancelStage
import com.netflix.spinnaker.orca.q.RescheduleExecution
import com.netflix.spinnaker.orca.q.RunTask
import com.netflix.spinnaker.q.Queue
import com.netflix.spinnaker.security.AuthenticatedRequest
import java.util.concurrent.Executor
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.stereotype.Component
Expand Down Expand Up @@ -86,10 +87,11 @@ class CancelStageHandler(
// for the time being we execute this off-thread as some cancel
// routines may run long enough to cause message acknowledgment to
// time out.
executor.execute {
val cancellationClosure = AuthenticatedRequest.propagate {
stage.withAuth {
builder.cancel(stage)
}

// Special case for PipelineStage to ensure prompt cancellation of
// child pipelines and deployment strategies regardless of task backoff
if (stage.type.equals("pipeline", true) && stage.context.containsKey("executionId")) {
Expand All @@ -100,6 +102,9 @@ class CancelStageHandler(
}
}
}
executor.execute {
cancellationClosure.call()
}
}
}
}
Expand Down