SteNicholas commented on code in PR #3544:
URL: https://github.com/apache/celeborn/pull/3544#discussion_r2545363293


##########
client/src/main/java/org/apache/celeborn/client/read/WorkerPartitionReader.java:
##########
@@ -191,12 +193,34 @@ public ByteBuf next() throws IOException, 
InterruptedException {
     }
     Pair<Integer, ByteBuf> chunk = null;
     try {
+      long totalWaitTimeMs = 0;
+      long lastLogTimeMs = 0;
+
       while (chunk == null) {
         checkException();
         Long startFetchWait = System.nanoTime();
         chunk = results.poll(pollChunkWaitTime, TimeUnit.MILLISECONDS);
-        metricsCallback.incReadTime(
-            TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startFetchWait));
+        long waitTimeMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - 
startFetchWait);
+        metricsCallback.incReadTime(waitTimeMs);
+        totalWaitTimeMs += waitTimeMs;
+        // Log when wait time exceeds another threshold since last log
+        if (chunk == null && totalWaitTimeMs >= lastLogTimeMs + 
partitionReaderWaitLogThreashold) {
+          lastLogTimeMs = totalWaitTimeMs;
+          logger.info(
+              "Waiting for data from partition {}/{} for {}ms",
+              location.getFileName(),
+              location.hostAndPorts(),

Review Comment:
   @xy2953396112, logging the `Ports` has no negative effect. Therefore, 
logging the `Ports` makes sense.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to