You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Batch idle guard uses or instead of and — premature flush in objects-only batches, throughput degraded #2105
The idle-guard condition in the automatic batch flusher uses or instead of and, causing premature flushes in batches that contain only objects (no references) or only references (no objects).
In an objects-only batch (no references being added), len_r is always 0 and len(self.__batch_references) is always 0, so the right-hand side of or is always True. This means the idle-guard fires after every sleep tick regardless of whether objects have accumulated — the batch flushes prematurely before reaching batch_size, degrading throughput.
Expected behavior
The guard should use and — a flush is "idle" (nothing changed) only when both the object count and the reference count are unchanged:
Activity
fix(batch): require both counts unchanged before the idle flush
Merge pull request #2109 from Anai-Guo/fix/batch-idle-guard-and