MCPcopy Index your code
hub / github.com/coder/coder / ForceStop

Method ForceStop

provisionerd/runner/runner.go:313–326  ·  view source on GitHub ↗

ForceStop signals all goroutines to stop and prevents any further API calls back to coder server for this job

()

Source from the content-addressed store, hash-verified

311
312// ForceStop signals all goroutines to stop and prevents any further API calls back to coder server for this job
313func (r *Runner) ForceStop() {
314 r.mutex.Lock()
315 defer r.mutex.Unlock()
316 r.stop()
317 if !r.okToSend {
318 return
319 }
320 r.okToSend = false
321 close(r.done)
322 // doesn't matter what we put here, since it won't get sent! Just need something to satisfy the condition in
323 // Start()
324 r.failedJob = &proto.FailedJob{}
325 r.cond.Signal()
326}
327
328func (r *Runner) sendHeartbeat(ctx context.Context) (*proto.UpdateJobResponse, error) {
329 ctx, span := r.startTrace(ctx, "updateHeartbeat")

Callers 1

closeWithErrorMethod · 0.95

Calls 4

stopMethod · 0.65
SignalMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected