Skip to content

Commit

Permalink
Check if there is anything to retry before figuring out if we
Browse files Browse the repository at this point in the history
have room to actually read from the queue.

If we don't check, we won't warn about being too busy.
  • Loading branch information
petersilva committed Nov 12, 2024
1 parent b91e14b commit c350c39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sarracenia/flowcb/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down

0 comments on commit c350c39

Please sign in to comment.