uber-archive / node-statsd-client

Node.js client for statsd
ISC License
28 stars 9 forks source link

gaurd against double close #19

Closed Raynos closed 9 years ago

Raynos commented 9 years ago

We ran into a production bug with this. It looks like somehow the socket was double closed and two timers were allocated.

This just gaurds against the socket not existing instead of removing the race condition completely.

cc @jsu1212 @sh1mmer @Matt-Esch @kriskowal

kriskowal commented 9 years ago

Looks sane. If the intention is to gracefully pass through the race case, but the race should eventually disappear, it might be good to put a nag of some kind in there.