Skip to content

Commit

Permalink
fix: division by zero error when computing stall time
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jun 2, 2024
1 parent d995915 commit ad3a82d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.21.4
- fix: division by zero error when computing stall time
0.21.3
- fix: negative stall time in log messages
0.21.2
Expand Down
2 changes: 1 addition & 1 deletion src/dcnum/feat/event_extractor_manager_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def run(self):
if (ldq := len(self.writer_dq)) > 1000:
time.sleep(1)
ldq2 = len(self.writer_dq)
stall_time = max(0., (ldq2 - 200) / (ldq - ldq2))
stall_time = max(0., (ldq2 - 200) / ((ldq - ldq2) or 1))
time.sleep(stall_time)
self.logger.warning(
f"Stalled {stall_time + 1:.1f}s for slow writer "
Expand Down

0 comments on commit ad3a82d

Please sign in to comment.