From bf89cfc085a08446f098f62a24084dfac566e0fb Mon Sep 17 00:00:00 2001 From: Jamie Date: Tue, 26 Mar 2024 12:55:20 -0400 Subject: [PATCH] Update bluesky_kafka/__init__.py Prevent potential infinite recursion by checking page_len Co-authored-by: Thomas A Caswell --- bluesky_kafka/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bluesky_kafka/__init__.py b/bluesky_kafka/__init__.py index 47a214a..75d0172 100644 --- a/bluesky_kafka/__init__.py +++ b/bluesky_kafka/__init__.py @@ -152,6 +152,8 @@ def __call__(self, name, doc): if KErr.code() == KafkaError.MSG_SIZE_TOO_LARGE: if name == "event_page": page_len = len(doc['seq_num']) + if page_len == 1: + raise new_event_list = rechunk_event_pages([doc], (page_len + 1)//2) for event in new_event_list: self.__call__(name, event)