bitly / statsdaemon

an implementation of Etsy's statsd in Go
The Unlicense
570 stars 131 forks source link

statsdameon breaks connection and doesn't send a data #8

Closed robert-zaremba closed 11 years ago

robert-zaremba commented 11 years ago

I want to use statsdaemon instead original statsd. But I can't managed it to work. I'm testing it with netcat:

nc -l -t -p 2003 -v -v

I'm running simply with:

./statsdaemon

After each dial it breaks the connection, and desn't send anything:

# netcat output
Listening on any address 2003 (brutus)
Connection from 127.0.0.1:42202
Total received bytes: 0
Total sent bytes: 0
[1]    28110 exit 1     nc -l -t -p 2003 -v -v

# statsdaemon output
2013/08/14 02:34:31 ERROR: dialing 127.0.0.1:2003 - dial tcp 127.0.0.1:2003: connection refused
mreiferson commented 11 years ago

@robert-zaremba I'm pretty sure netcat will only accept one connection.

statsdaemon won't send any data if it hasn't collected anything...

robert-zaremba commented 11 years ago

The issue is that it breaks connection without sending anything. I was also testing it by connecting a statsd client and using netcat:

echo 'abc.def:10|c' | nc -w 1 -u localhost 8125

statsdaemon didn't send anything

mreiferson commented 11 years ago

I tested and was able to reproduce, thanks @robert-zaremba

It was spinning on ReadFromUDP() from cleanup in #7 (see attached commit)

ready @jehiah