Skip to content

data race during daemon startup (libcontainerd/supervisor.(*remote).monitorDaemon()) #47287

@corhere

Description

@corhere

Description

==================
WARNING: DATA RACE
Read at 0x00c000d741e0 by goroutine 52:
  github.com/docker/docker/libcontainerd/supervisor.(*remote).monitorDaemon()
      /go/src/github.com/docker/docker/libcontainerd/supervisor/remote_daemon.go:332 +0xf3b
  github.com/docker/docker/libcontainerd/supervisor.Start.func1()
      /go/src/github.com/docker/docker/libcontainerd/supervisor/remote_daemon.go:99 +0x4f

Previous write at 0x00c000d741e0 by goroutine 54:
  github.com/docker/docker/libcontainerd/supervisor.(*remote).startContainerd.func1()
      /go/src/github.com/docker/docker/libcontainerd/supervisor/remote_daemon.go:198 +0x104

Goroutine 52 (running) created at:
  github.com/docker/docker/libcontainerd/supervisor.Start()
      /go/src/github.com/docker/docker/libcontainerd/supervisor/remote_daemon.go:99 +0x84c
  main.(*DaemonCli).initContainerd()
      /go/src/github.com/docker/docker/cmd/dockerd/daemon_unix.go:141 +0x3ec
  main.(*DaemonCli).start()
      /go/src/github.com/docker/docker/cmd/dockerd/daemon.go:184 +0xf74
  main.runDaemon()
      /go/src/github.com/docker/docker/cmd/dockerd/docker_unix.go:13 +0x12e
  main.newDaemonCommand.func1()
      /go/src/github.com/docker/docker/cmd/dockerd/docker.go:37 +0x12f
  github.com/spf13/cobra.(*Command).execute()
      /go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:983 +0xf77
  github.com/spf13/cobra.(*Command).ExecuteC()
      /go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1115 +0x657
  github.com/spf13/cobra.(*Command).Execute()
      /go/src/github.com/docker/docker/vendor/github.com/spf13/cobra/command.go:1039 +0x254
  main.main()
      /go/src/github.com/docker/docker/cmd/dockerd/docker.go:106 +0x255

Goroutine 54 (running) created at:
  github.com/docker/docker/libcontainerd/supervisor.(*remote).startContainerd()
      /go/src/github.com/docker/docker/libcontainerd/supervisor/remote_daemon.go:182 +0x964
  github.com/docker/docker/libcontainerd/supervisor.(*remote).monitorDaemon()
      /go/src/github.com/docker/docker/libcontainerd/supervisor/remote_daemon.go:290 +0x3c4
  github.com/docker/docker/libcontainerd/supervisor.Start.func1()
      /go/src/github.com/docker/docker/libcontainerd/supervisor/remote_daemon.go:99 +0x4f
==================

Reproduce

Build a binary with BUILDFLAGS=-race and run it.

Expected behavior

The data race detector doesn't complain

docker version

some dirty tree close to 8a81b9d35fb89251437bd046d2154f6c73b22f7c

docker info

N/A

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/daemonCore Enginekind/bugBugs are bugs. The cause may or may not be known at triage time so debugging may be needed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions