From 6b20819a8d7b3c46a13d4ebbe8a44de8df849984 Mon Sep 17 00:00:00 2001 From: Attila Szakacs Date: Mon, 7 Oct 2024 11:26:20 +0200 Subject: [PATCH] fixup: fix init window and fetch limit calculation --- modules/grpc/common/grpc-source.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/grpc/common/grpc-source.cpp b/modules/grpc/common/grpc-source.cpp index 3eeb93771..e1f51bd5d 100644 --- a/modules/grpc/common/grpc-source.cpp +++ b/modules/grpc/common/grpc-source.cpp @@ -47,10 +47,13 @@ SourceDriver::init() ::grpc::EnableDefaultHealthCheckService(true); - this->super->super.worker_options.super.init_window_size /= super->super.num_workers; - if (fetch_limit == -1) - fetch_limit = this->super->super.worker_options.super.init_window_size; + { + if (super->super.worker_options.super.init_window_size != -1) + fetch_limit = super->super.worker_options.super.init_window_size / super->super.num_workers; + else + fetch_limit = 100; + } return log_threaded_source_driver_init_method(&this->super->super.super.super.super); }