From 0eb27174f0013eb48fbc9c6203350ae624c66518 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 9 Dec 2025 20:50:44 -0500 Subject: [PATCH] fix batch: default high watermark was wrong --- src/client/batch.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client/batch.ml b/src/client/batch.ml index 7e75fb99..110d9514 100644 --- a/src/client/batch.ml +++ b/src/client/batch.ml @@ -13,7 +13,7 @@ type 'a t = { timeout: Mtime.span option; } -let default_high_watermark batch_size = min 10 (max (batch_size * 10) 1_000_000) +let default_high_watermark batch_size = max 10 (min (batch_size * 10) 1_000_000) let _dummy_start = Mtime.min_stamp @@ -83,8 +83,9 @@ let push (self : _ t) elems : [ `Dropped | `Ok ] = let now = lazy (Mtime_clock.now ()) in Util_atomic.update_cas self.st @@ fun state -> if state.size >= self.high_watermark then - (* drop this to prevent queue from growing too fast *) - `Dropped, state + ( (* drop this to prevent queue from growing too fast *) + `Dropped, + state ) else ( let start = if state.size = 0 && Option.is_some self.timeout then