bookingcom / nanotube

High-performance router for Graphite.
Apache License 2.0
56 stars 12 forks source link

Add config check that SendTimeoutSec > TCPOutBufFlushPeriodSec #54

Closed avereha closed 4 years ago

avereha commented 4 years ago

If SendTimeoutSec<TCPOutBufFlushPeriodSec then this can happen:

We set write timeout to X. Then we write in the buffer. Record is not flushed because buffer is not full. Timeout occurs.

When SendTimeoutSec>TCPOutBufFlushPeriodSec we will get at least one flush before the Timeout.

We can add check in nanotube config for this condition.

grzkv commented 4 years ago

I have tested this with a sample setup. This happens in real life. Even though the SendTimeoutSec timeout is set for Write operation that happens right away, since it's set on the Conn, it still applies when buffer is flushed. Needs fixing.