From da84b9d7d8f7a14efca55a6026192b8d3f8f7277 Mon Sep 17 00:00:00 2001 From: CoreidCC Date: Thu, 9 Jan 2025 08:57:43 +0100 Subject: [PATCH] in_kafka: formatting adjustments --- plugins/in_kafka/in_kafka.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/plugins/in_kafka/in_kafka.c b/plugins/in_kafka/in_kafka.c index 395217cc378..c829f451632 100644 --- a/plugins/in_kafka/in_kafka.c +++ b/plugins/in_kafka/in_kafka.c @@ -181,7 +181,7 @@ static int in_kafka_collect(struct flb_input_instance *ins, rd_kafka_message_destroy(rkm); - if(!ctx->enable_auto_commit) { + if (!ctx->enable_auto_commit) { if (ret == FLB_EVENT_ENCODER_SUCCESS) { rd_kafka_commit(ctx->kafka.rk, NULL, 0); } @@ -248,24 +248,23 @@ static int in_kafka_init(struct flb_input_instance *ins, goto init_error; } - /* Set the kafka poll timeout dependend on wether we run in our own - * or in the main event thread. - * a) run in main event thread: - * -> minimize the delay we might create - * b) run in our own thread: - * -> optimize for throuput and relay on 'fetch.wait.max.ms' - * which is set to 500 by default default. wa algin our - * timeout with what is set for 'fetch.wait.max.ms' - */ + /* Set the kafka poll timeout dependend on wether we run in our own */ + /* or in the main event thread. */ + /* a) run in main event thread: */ + /* -> minimize the delay we might create */ + /* b) run in our own thread: */ + /* -> optimize for throuput and relay on 'fetch.wait.max.ms' */ + /* which is set to 500 by default default. wa algin our */ + /* timeout with what is set for 'fetch.wait.max.ms' */ ctx->poll_timeount_ms = 1; if (ins->is_threaded) { ctx->poll_timeount_ms = 550; // ensure kafa triggers timeout - // align our timeout with what was configured for fetch.wait.max.ms + /* align our timeout with what was configured for fetch.wait.max.ms */ dsize = sizeof(conf_val); res = rd_kafka_conf_get(kafka_conf, "fetch.wait.max.ms", conf_val, &dsize); if (res == RD_KAFKA_CONF_OK && dsize <= sizeof(conf_val)) { - // add 50ms so kafa triggers timout + /* add 50ms so kafa triggers timeout */ ctx->poll_timeount_ms = atoi(conf_val) + 50; } }