MCPcopy
hub / github.com/containerd/containerd / Start

Method Start

client/process.go:123–144  ·  view source on GitHub ↗

Start starts the exec process

(ctx context.Context)

Source from the content-addressed store, hash-verified

121
122// Start starts the exec process
123func (p *process) Start(ctx context.Context) error {
124 ctx, span := tracing.StartSpan(ctx, "process.Start",
125 tracing.WithAttribute("process.id", p.ID()),
126 tracing.WithAttribute("process.task.id", p.task.ID()),
127 )
128 defer span.End()
129 r, err := p.task.client.TaskService().Start(ctx, &tasks.StartRequest{
130 ContainerID: p.task.id,
131 ExecID: p.id,
132 })
133 if err != nil {
134 if p.io != nil {
135 p.io.Cancel()
136 p.io.Wait()
137 p.io.Close()
138 }
139 return errgrpc.ToNative(err)
140 }
141 span.SetAttributes(tracing.Attribute("process.pid", int(r.Pid)))
142 p.pid = r.Pid
143 return nil
144}
145
146func (p *process) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts) error {
147 ctx, span := tracing.StartSpan(ctx, "process.Kill",

Callers

nothing calls this directly

Calls 12

IDMethod · 0.95
StartSpanFunction · 0.92
WithAttributeFunction · 0.92
AttributeFunction · 0.92
EndMethod · 0.80
TaskServiceMethod · 0.80
SetAttributesMethod · 0.80
IDMethod · 0.65
StartMethod · 0.65
CancelMethod · 0.65
WaitMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected