jjneely / statsrelay

A Golang consistent hashing proxy for statsd
MIT License
56 stars 19 forks source link

Bug with using `ctarget` variable #29

Closed calh closed 3 years ago

calh commented 3 years ago

This prints messages to the log like:

2021/03/03 15:14:42 TCP error for  - dial tcp: missing address [Reconnecting in 50ms, retries left 3/3]
2021/03/03 15:14:42 TCP error for  - dial tcp: missing address [Reconnecting in 75ms, retries left 2/3]
2021/03/03 15:14:42 TCP error for  - dial tcp: missing address [Reconnecting in 112.5ms, retries left 1/3]
2021/03/03 15:14:55 TCP error for  - dial tcp: missing address [Reconnecting in 50ms, retries left 3/3]
2021/03/03 15:14:55 TCP error for  - dial tcp: missing address [Reconnecting in 75ms, retries left 2/3]
2021/03/03 15:14:55 TCP error for  - dial tcp: missing address [Reconnecting in 112.5ms, retries left 1/3]

because the ctarget variable is out of scope at this point. Occasionally I see segfaults at this line.

Note: This is using the default dnscache=false to see this

jjneely commented 3 years ago

Lovely!