brubeck icon indicating copy to clipboard operation
brubeck copied to clipboard

Single metric still stuck

Open deanbittner opened this issue 9 years ago • 2 comments

In addition to a previous change (#38) ... the following are required to avoid the stuck metric ...

diff --git a/src/samplers/statsd.c b/src/samplers/statsd.c
index 62cb33e..4d6c515 100644
--- a/src/samplers/statsd.c
+++ b/src/samplers/statsd.c
@@ -51,9 +51,9 @@ static void statsd_run_recvmmsg(struct brubeck_statsd *statsd, int sock)
                }

                /* store stats */
-               brubeck_atomic_add(&statsd->sampler.inflow, SIM_PACKETS);
+               brubeck_atomic_add(&statsd->sampler.inflow, res);

-               for (i = 0; i < SIM_PACKETS; ++i) {
+               for (i = 0; i < res; ++i) {
                        char *buf = msgs[i].msg_hdr.msg_iov->iov_base;
                        char *end = buf + msgs[i].msg_len;
                        brubeck_statsd_packet_parse(server, buf, end);

These were included in the original patch. Without these additional changes, a single metric in an otherwise idle system is still stuck.

deanbittner avatar Jul 12 '16 20:07 deanbittner

@deanbittner Thank you so much for the patch! Brubeck is not working without it for us.

Our case is with gauges which are computed and output only once per interval, but I am surprised the bug does not seem more frequent.

ealphonse avatar Aug 15 '17 17:08 ealphonse

Setting multimsg: 1 - (it was 8) - resolved this issue for me as well.. so this patch should hopefully fix it for me as well.

KlavsKlavsen avatar Apr 04 '18 08:04 KlavsKlavsen