From 5bc1bdc489a17ea8799bd75aefb066169fb0a11c Mon Sep 17 00:00:00 2001 From: Tio Pramayudi Date: Mon, 29 Jan 2024 08:53:30 +0700 Subject: [PATCH] Call poll after produce to reduce usage of producer queue limit --- python/pyfunc-server/pyfuncserver/publisher/kafka.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/pyfunc-server/pyfuncserver/publisher/kafka.py b/python/pyfunc-server/pyfuncserver/publisher/kafka.py index 989664318..d2e5863cf 100644 --- a/python/pyfunc-server/pyfuncserver/publisher/kafka.py +++ b/python/pyfunc-server/pyfuncserver/publisher/kafka.py @@ -23,3 +23,4 @@ def produce(self, data: PyFuncOutput): prediction_log = build_prediction_log(pyfunc_output=data, model_manifest=self.model_manifest) serialized_data = prediction_log.SerializeToString() self.producer.produce(topic=self.topic, value=serialized_data) + self.producer.poll(0)