From 597148ed5a6cfd13d7943318e0676ba6538ccfb9 Mon Sep 17 00:00:00 2001 From: Sean Shahkarami Date: Thu, 21 Aug 2025 10:33:27 -0500 Subject: [PATCH 1/2] check for write timeout --- main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.py b/main.py index f919f85..32fa5d6 100644 --- a/main.py +++ b/main.py @@ -152,6 +152,10 @@ def flush(self): # to be more proactive about the problem. logging.error("error when writing batch: %s", exc.message) + # For a write timeout, we want to fail and retry the whole batch. + if "timeout" in exc.message: + raise + # ack entire batch logging.info("acking batch") for ch, method, properties, body in self.batch: From 865fca475e945935c4f9e01a2ecfc7e318a4ce9a Mon Sep 17 00:00:00 2001 From: Sean Shahkarami Date: Thu, 21 Aug 2025 10:36:10 -0500 Subject: [PATCH 2/2] ensure exception message is a string --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 32fa5d6..7111013 100644 --- a/main.py +++ b/main.py @@ -150,10 +150,12 @@ def flush(self): # Although the write goes through for the valid data points, getting this info # could be helpful for debugging. We may need to leverage a known schema later # to be more proactive about the problem. - logging.error("error when writing batch: %s", exc.message) + msg = str(exc.message) + + logging.error("error when writing batch: %s", msg) # For a write timeout, we want to fail and retry the whole batch. - if "timeout" in exc.message: + if "timeout" in msg: raise # ack entire batch