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); }