From 220f9cfad34dbab0b874da5d1764243c17738f2e Mon Sep 17 00:00:00 2001 From: Peter Silva Date: Tue, 12 Nov 2024 14:27:49 -0500 Subject: [PATCH] Check if there is anything to retry before figuring out if we have room to actually read from the queue. If we don't check, we won't warn about being too busy. --- sarracenia/flowcb/retry.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sarracenia/flowcb/retry.py b/sarracenia/flowcb/retry.py index ca4bef880..247476b8b 100755 --- a/sarracenia/flowcb/retry.py +++ b/sarracenia/flowcb/retry.py @@ -102,10 +102,15 @@ def after_accept(self, worklist) -> None: if not features['retry']['present'] or self.o.retry_refilter: return + if len(self.download_retry) < 1: + return + qty = (self.o.batch / 2) - len(worklist.incoming) #logger.info('qty: %d len(worklist.incoming) %d' % ( qty, len(worklist.incoming) ) ) - if qty <= 0: return + if qty <= 0: + logger.info( f"{len(worklist.incoming)} messages to process, too busy to retry" ) + return mlist = self.download_retry.get(qty) @@ -126,6 +131,9 @@ def after_work(self, worklist) -> None: self.download_retry.put(worklist.failed) worklist.failed = [] + if len(self.post_retry) < 1: + return + # retry posting... if (self.o.batch > 2): qty = self.o.batch // 2 - len(worklist.ok)