X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/53c32bc8834b7e6e64c0c001d95b951c0a762b82..ee9d1e39b5d469a827be5a719c9c0860914ab2a8:/lib/crunchrun/docker.go diff --git a/lib/crunchrun/docker.go b/lib/crunchrun/docker.go index e547f81706..4f449133f3 100644 --- a/lib/crunchrun/docker.go +++ b/lib/crunchrun/docker.go @@ -195,8 +195,15 @@ func (e *dockerExecutor) Create(spec containerSpec) error { return e.startIO(spec.Stdin, spec.Stdout, spec.Stderr) } -func (e *dockerExecutor) CgroupID() string { - return e.containerID +func (e *dockerExecutor) Pid() int { + ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(10*time.Second)) + defer cancel() + ctr, err := e.dockerclient.ContainerInspect(ctx, e.containerID) + if err == nil && ctr.State != nil { + return ctr.State.Pid + } else { + return 0 + } } func (e *dockerExecutor) Start() error {