Copilot commented on code in PR #6179:
URL: https://github.com/apache/ignite-3/pull/6179#discussion_r2179966143


##########
modules/core/src/main/java/org/apache/ignite/internal/streamer/StreamerBuffer.java:
##########
@@ -56,6 +63,7 @@ void add(T item) {
             if (buf.size() >= capacity) {
                 bufToFlush = buf;
                 buf = new ArrayList<>(capacity);
+                lastFlushNanos = System.nanoTime();
             }

Review Comment:
   Updating `lastFlushNanos` inside `add` may drift the timestamp before the 
flush actually occurs. It’s safer to update it in `flushBuf` when the flush 
future is scheduled.
   ```suggestion
               }
   ```



##########
modules/core/src/main/java/org/apache/ignite/internal/streamer/StreamerBuffer.java:
##########
@@ -106,6 +125,10 @@ private void flushBuf(@Nullable List<T> bufToFlush) {
             return;
         }
 
-        flusher.accept(bufToFlush);
+        CompletableFuture<?> fut = flusher.apply(bufToFlush);

Review Comment:
   Consider also updating `lastFlushNanos` here after scheduling the flush to 
ensure a single source of truth for when the last flush happened.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to