MCPcopy
hub / github.com/containerd/containerd / Wait

Method Wait

client/process.go:168–194  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

166}
167
168func (p *process) Wait(ctx context.Context) (<-chan ExitStatus, error) {
169 c := make(chan ExitStatus, 1)
170 go func() {
171 defer close(c)
172 ctx, span := tracing.StartSpan(ctx, "process.Wait",
173 tracing.WithAttribute("process.id", p.ID()),
174 tracing.WithAttribute("process.task.id", p.task.ID()),
175 )
176 defer span.End()
177 r, err := p.task.client.TaskService().Wait(ctx, &tasks.WaitRequest{
178 ContainerID: p.task.id,
179 ExecID: p.id,
180 })
181 if err != nil {
182 c <- ExitStatus{
183 code: UnknownExitStatus,
184 err: err,
185 }
186 return
187 }
188 c <- ExitStatus{
189 code: r.ExitStatus,
190 exitedAt: protobuf.FromTimestamp(r.ExitedAt),
191 }
192 }()
193 return c, nil
194}
195
196func (p *process) CloseIO(ctx context.Context, opts ...IOCloserOpts) error {
197 ctx, span := tracing.StartSpan(ctx, "process.CloseIO",

Callers

nothing calls this directly

Calls 8

IDMethod · 0.95
StartSpanFunction · 0.92
WithAttributeFunction · 0.92
FromTimestampFunction · 0.92
EndMethod · 0.80
TaskServiceMethod · 0.80
IDMethod · 0.65
WaitMethod · 0.65

Tested by

no test coverage detected