grobian / carbon-c-relay

Enhanced C implementation of Carbon relay, aggregator and rewriter
Apache License 2.0
380 stars 107 forks source link

parameter -m N is not working for some metrics #425

Closed xor-eax-ebx closed 4 months ago

xor-eax-ebx commented 3 years ago

sometimes -m N is not working, for very very long metric names

how to reproduce:

carbon-c-relay does not delete such invalid metrics, but forwards them

probably end of buffer (without newline characters) is omitted here: https://github.com/grobian/carbon-c-relay/blob/master/dispatcher.c#L914-L922

grobian commented 3 years ago

Is this the full metric, or a part of it that gets forwarded? I can imagine somehow that the end of a metric is seen, with its values.

xor-eax-ebx commented 3 years ago

full metric with value & timestamp

I think problem is not related to size of one metric name, but to large bulks of metrics. In my database (clickhouse) I have many metrics 600-1000B length. They all passed through carbon-c-relay with -m 500 parameter.

grobian commented 3 years ago

ok, that should be easy to test

grobian commented 4 months ago

I tried this:

printf "x%01000d 1 2\n" 1 > longmetric.tst
nc localhost 2003 < longmetric.tst 

using a conf like this one ``` cluster out file ip /dev/stdout ;
match * send to out ;



and it prints the metric by default, but it drops it when using `-m500` here.

I increased the size to 10K but it still does not show the metric getting through.  I repeated the 10K 15 times to get a large(r) block and still I could not reproduce this behaviour.

If you have a reproducer, please share.