bitly/go-nsq — pull request #45 by mreiferson (2014-06-14 15:22:59+00:00)
Title: Panic via nsq.Producer

I'm writing a [message dispatcher](http://github.com/philhofer/fluxlog) based on nsq. I'm running into a panic that seems to be originating within the go-nsq library (or, so says the stack trace). Any ideas? The panic occurs [on this line](https://github.com/bitly/go-nsq/blob/master/conn.go/#L632).
![screen shot 2014-06-13 at 3 33 39 pm](https://cloud.githubusercontent.com/assets/2940902/3274608/b2c7c632-f331-11e3-8e26-69f88055f638.png)
The test case in question can be found [here](https://github.com/philhofer/fluxlog/blob/master/nsqlog_test.go#L66).

Try it for yourself:
Start `nsqd` running (locally), then:
```
go get github.com/philhofer/fluxlog
cd $GOPATH/github.com/philhofer/fluxlog
go test -v -tags 'nsq'
```
(I'm compiling with go1.3rc1, because my package depends on sync.Pool.)

The test tries to write 10 messages to a topic called "test" - which seems to work ok. Then the *nsq.Producer code tries to close the tcp connection, and everything goes to hell.

This may be an issue on my end, but if it is, I can't find it.

Thanks in advance.