You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "Z1Wu (via GitHub)" <gi...@apache.org> on 2025/02/08 09:31:49 UTC

[PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Z1Wu opened a new pull request, #3093:
URL: https://github.com/apache/celeborn/pull/3093

   ### What changes were proposed in this pull request?
   
   DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request like WorkerPartitionReader instead of sending another OpenStream Request.
   
   ### Why are the changes needed?
   
   Reduce unnecessary rpc requests
   
   ### Does this PR introduce _any_ user-facing change?
   
   No
   
   ### How was this patch tested?
   
   Test manually in test cluster 


-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "Z1Wu (via GitHub)" <gi...@apache.org>.
Z1Wu commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1951107309


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
-        streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
+          streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   `closeStream ` will use `streamHandler.getStreamId()` only when `client` is initialized and send request to worker to open stream. 
   
   https://github.com/apache/celeborn/blob/299a0483d47e4f7fce86c8d914b5f6f8eb26ea3e/client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java#L282-L294
   
   You can also refer to the scenario when `DfsPartitionReader` read a non-sorted file and there is also no initialization of  `streamHandler`
   
   https://github.com/apache/celeborn/blob/299a0483d47e4f7fce86c8d914b5f6f8eb26ea3e/client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java#L129-L132



-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "Z1Wu (via GitHub)" <gi...@apache.org>.
Z1Wu commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1952810661


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
-        streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
+          streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   Fixed. Please review it again.



-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1950924232


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
-        streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
+          streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   closeStream will use `streamHandler.getStreamId()`



-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong closed pull request #3093: [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request
URL: https://github.com/apache/celeborn/pull/3093


-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1952030446


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
-        streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
+          streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   You are correct, but the closeStream method should create a client to send a request to the worker to end the stream. This allows the worker to safely delete the original file. It's important to note that the stream must also be opened before reading. Therefore, it's incorrect to create the client only during the map range read, so the check for endMapIndex != Integer.MAX_VALUE should be removed in DfsPartitionReader. For more details, please refer to https://github.com/apache/celeborn/pull/1932



-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#issuecomment-2661793469

   Merge to main(v0.6.0) and branch-0.5(v0.5.4)


-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "Z1Wu (via GitHub)" <gi...@apache.org>.
Z1Wu commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1950788216


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
-        streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
+          streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   For `DfsPartitionReader`, if we have already got a valid `pbStreamHandler` from `BatchOpenStream` request, it means partition file has been sorted and ready to be fetched. We don't need to perform any additional operations.



-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "Z1Wu (via GitHub)" <gi...@apache.org>.
Z1Wu commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1951107309


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
-        streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
+          streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   `closeStream ` will use `streamHandler.getStreamId()` only when `client` is initialized and send request to worker to open stream. 
   
   https://github.com/apache/celeborn/blob/299a0483d47e4f7fce86c8d914b5f6f8eb26ea3e/client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java#L282-L294
   
   You can also refer to the scenario when `DfsPartitionReader` reads a non-sorted file and there is also no initialization of  `streamHandler`
   
   https://github.com/apache/celeborn/blob/299a0483d47e4f7fce86c8d914b5f6f8eb26ea3e/client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java#L129-L132



-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#issuecomment-2653990637

   ## [Codecov](https://app.codecov.io/gh/apache/celeborn/pull/3093?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 32.67%. Comparing base [(`fdf1883`)](https://app.codecov.io/gh/apache/celeborn/commit/fdf1883f2520f4e7a18f7bd934dece7f2cb5b2b3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`35e0cc6`)](https://app.codecov.io/gh/apache/celeborn/commit/35e0cc64b688467b7e552465179a244327466c16?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 11 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@            Coverage Diff             @@
   ##             main    #3093      +/-   ##
   ==========================================
   + Coverage   32.62%   32.67%   +0.05%     
   ==========================================
     Files         336      337       +1     
     Lines       20083    20109      +26     
     Branches     1798     1800       +2     
   ==========================================
   + Hits         6551     6569      +18     
   - Misses      13165    13174       +9     
   + Partials      367      366       -1     
   ```
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/celeborn/pull/3093?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "RexXiong (via GitHub)" <gi...@apache.org>.
RexXiong commented on code in PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#discussion_r1949151085


##########
client/src/main/java/org/apache/celeborn/client/read/DfsPartitionReader.java:
##########
@@ -97,26 +98,28 @@ public DfsPartitionReader(
 
     if (endMapIndex != Integer.MAX_VALUE) {
       long fetchTimeoutMs = conf.clientFetchTimeoutMs();
-      try {
-        client = clientFactory.createClient(location.getHost(), location.getFetchPort());
-        TransportMessage openStream =
-            new TransportMessage(
-                MessageType.OPEN_STREAM,
-                PbOpenStream.newBuilder()
-                    .setShuffleKey(shuffleKey)
-                    .setFileName(location.getFileName())
-                    .setStartIndex(startMapIndex)
-                    .setEndIndex(endMapIndex)
-                    .build()
-                    .toByteArray());
-        ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
-        streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
-        // Parse this message to ensure sort is done.
-      } catch (IOException | InterruptedException e) {
-        throw new IOException(
-            "read shuffle file from DFS failed, filePath: "
-                + location.getStorageInfo().getFilePath(),
-            e);
+      if (pbStreamHandler == null) {
+        try {
+          client = clientFactory.createClient(location.getHost(), location.getFetchPort());
+          TransportMessage openStream =
+              new TransportMessage(
+                  MessageType.OPEN_STREAM,
+                  PbOpenStream.newBuilder()
+                      .setShuffleKey(shuffleKey)
+                      .setFileName(location.getFileName())
+                      .setStartIndex(startMapIndex)
+                      .setEndIndex(endMapIndex)
+                      .build()
+                      .toByteArray());
+          ByteBuffer response = client.sendRpcSync(openStream.toByteBuffer(), fetchTimeoutMs);
+          streamHandler = TransportMessage.fromByteBuffer(response).getParsedPayload();
+          // Parse this message to ensure sort is done.
+        } catch (IOException | InterruptedException e) {
+          throw new IOException(
+              "read shuffle file from DFS failed, filePath: "
+                  + location.getStorageInfo().getFilePath(),
+              e);
+        }

Review Comment:
   lost else branch?



-- 
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: issues-unsubscribe@celeborn.apache.org

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


Re: [PR] [CELEBORN-1859] DfsPartitionReader and LocalPartitionReader should reuse pbStreamHandlers get from BatchOpenStream request [celeborn]

Posted by "Z1Wu (via GitHub)" <gi...@apache.org>.
Z1Wu commented on PR #3093:
URL: https://github.com/apache/celeborn/pull/3093#issuecomment-2645348691

   Unit-test fails seem unrelated to this patch. Not very familiar with Flink, correct me if I have any misunderstandings.


-- 
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: issues-unsubscribe@celeborn.apache.org

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