1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/libnetwork/bitseq
Alexander Morozov d0f3f77432 bitseq: fix race between CopyTo and set
Race detector message:

WARNING: DATA RACE
Write by goroutine 269:
  github.com/docker/libnetwork/bitseq.(*Handle).CopyTo()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/store.go:85 +0x2f6
  github.com/docker/libnetwork/datastore.(*cache).get()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/datastore/cache.go:135 +0x307
  github.com/docker/libnetwork/datastore.(*datastore).GetObject()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/datastore/datastore.go:438 +0x121
  github.com/docker/libnetwork/bitseq.(*Handle).set()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:254 +0x1a5
  github.com/docker/libnetwork/bitseq.(*Handle).Unset()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:227 +0xb0
  github.com/docker/libnetwork/ipam.(*Allocator).ReleaseAddress()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/ipam/allocator.go:446 +0x10bc
  github.com/docker/libnetwork.(*endpoint).releaseAddress()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:830 +0x731
  github.com/docker/libnetwork.(*endpoint).Delete()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:624 +0x8d8
  github.com/docker/libnetwork.(*sandbox).Delete()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox.go:191 +0x1047
  github.com/docker/docker/daemon.(*Daemon).releaseNetwork()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/container_unix.go:1180 +0x676
  github.com/docker/docker/daemon.(*Daemon).Cleanup()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:157 +0x5d
  github.com/docker/docker/daemon.(*containerMonitor).Close()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:111 +0xa4
  github.com/docker/docker/daemon.(*containerMonitor).Start.func1()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:142 +0x14b
  github.com/docker/docker/daemon.(*containerMonitor).Start()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:223 +0x1159
  github.com/docker/docker/daemon.(*containerMonitor).Start-fm()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:147 +0x3b
  github.com/docker/docker/pkg/promise.Go.func1()
      /home/moroz/project/workspace/src/github.com/docker/docker/pkg/promise/promise.go:8 +0x2a

Previous read by goroutine 340:
  github.com/docker/libnetwork/bitseq.(*Handle).set()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:254 +0x133
  github.com/docker/libnetwork/bitseq.(*Handle).Unset()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/bitseq/sequence.go:227 +0xb0
  github.com/docker/libnetwork/ipam.(*Allocator).ReleaseAddress()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/ipam/allocator.go:446 +0x10bc
  github.com/docker/libnetwork.(*endpoint).releaseAddress()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:830 +0x731
  github.com/docker/libnetwork.(*endpoint).Delete()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/endpoint.go:624 +0x8d8
  github.com/docker/libnetwork.(*sandbox).Delete()
      /home/moroz/project/workspace/src/github.com/docker/docker/vendor/src/github.com/docker/libnetwork/sandbox.go:191 +0x1047
  github.com/docker/docker/daemon.(*Daemon).releaseNetwork()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/container_unix.go:1180 +0x676
  github.com/docker/docker/daemon.(*Daemon).Cleanup()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:157 +0x5d
  github.com/docker/docker/daemon.(*containerMonitor).Close()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:111 +0xa4
  github.com/docker/docker/daemon.(*containerMonitor).Start.func1()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:142 +0x14b
  github.com/docker/docker/daemon.(*containerMonitor).Start()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/monitor.go:223 +0x1159
  github.com/docker/docker/daemon.(*containerMonitor).Start-fm()
      /home/moroz/project/workspace/src/github.com/docker/docker/daemon/start.go:147 +0x3b
  github.com/docker/docker/pkg/promise.Go.func1()
      /home/moroz/project/workspace/src/github.com/docker/docker/pkg/promise/promise.go:8 +0x2a

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-11-30 13:18:52 -08:00
..
sequence.go bitseq: fix race between CopyTo and set 2015-11-30 13:18:52 -08:00
sequence_test.go Fix bug in bitsequence.pushReservation 2015-11-24 10:23:58 -08:00
store.go Phase-2 bridge driver changes to support IPAM 2015-10-08 16:22:03 -07:00