bitly/nsq — pull request #315 by mreiferson (2014-02-17 19:00:52+00:00)
Title: nsqd: TestSampling data race

yay for running tests w/ `-race`:

```
=== RUN TestSampling-4
==================
WARNING: DATA RACE
Read by goroutine 106:
runtime.mapiternext()
/home/travis/.gvm/gos/go1.1.2/src/pkg/runtime/hashmap.c:1409 +0x0
github.com/bitly/nsq/nsqd.(*Channel).exit()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/channel.go:182 +0x2ec
github.com/bitly/nsq/nsqd.(*Channel).Close()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/channel.go:163 +0x37
github.com/bitly/nsq/nsqd.(*Topic).exit()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/topic.go:318 +0x530
github.com/bitly/nsq/nsqd.(*Topic).Close()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/topic.go:276 +0x37
github.com/bitly/nsq/nsqd.(*NSQD).Exit()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/nsqd.go:273 +0x26b
github.com/bitly/nsq/nsqd.TestSampling()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/protocol_v2_test.go:959 +0xc4c
testing.tRunner()
/home/travis/.gvm/gos/go1.1.2/src/pkg/testing/testing.go:353 +0x12f
gosched0()
/home/travis/.gvm/gos/go1.1.2/src/pkg/runtime/proc.c:1218 +0x9f
Previous write by goroutine 115:
runtime.mapdelete()
/home/travis/.gvm/gos/go1.1.2/src/pkg/runtime/hashmap.c:1307 +0x0
github.com/bitly/nsq/nsqd.(*Channel).RemoveClient()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/channel.go:421 +0x185
github.com/bitly/nsq/nsqd.(*ProtocolV2).IOLoop()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/protocol_v2.go:97 +0x40a
github.com/bitly/nsq/nsqd.(*tcpServer).Handle()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/tcp.go:43 +0x56f
gosched0()
/home/travis/.gvm/gos/go1.1.2/src/pkg/runtime/proc.c:1218 +0x9f
Goroutine 106 (running) created at:
testing.RunTests()
/home/travis/.gvm/gos/go1.1.2/src/pkg/testing/testing.go:433 +0xaef
testing.Main()
/home/travis/.gvm/gos/go1.1.2/src/pkg/testing/testing.go:365 +0xab
main.main()
github.com/bitly/nsq/nsqd/_test/_testmain.go:217 +0xda
runtime.main()
/home/travis/.gvm/gos/go1.1.2/src/pkg/runtime/proc.c:182 +0x91
Goroutine 115 (running) created at:
github.com/bitly/nsq/util.TCPServer()
/home/travis/gopath/src/github.com/bitly/nsq/util/tcp_server.go:31 +0x55b
github.com/bitly/nsq/nsqd.func·012()
/home/travis/gopath/src/github.com/bitly/nsq/nsqd/nsqd.go:115 +0xad
github.com/bitly/nsq/util.func·002()
/home/travis/gopath/src/github.com/bitly/nsq/util/wait_group_wrapper.go:14 +0x4c
gosched0()
/home/travis/.gvm/gos/go1.1.2/src/pkg/runtime/proc.c:1218 +0x9f
```