Copilot commented on code in PR #3784:
URL: https://github.com/apache/celeborn/pull/3784#discussion_r3726163920
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/FetchHandler.scala:
##########
@@ -147,36 +148,48 @@ class FetchHandler(
val startIndices = openStreamList.getStartIndexList
val endIndices = openStreamList.getEndIndexList
val readLocalFlags = openStreamList.getReadLocalShuffleList
- val pbOpenStreamListResponse = PbOpenStreamListResponse.newBuilder()
checkAuth(client, Utils.splitShuffleKey(shuffleKey)._1)
val openStreamRequestId = Utils.makeOpenStreamRequestId(
shuffleKey,
client.getChannel.id().toString,
rpcRequest.requestId)
workerSource.startTimer(WorkerSource.OPEN_STREAM_TIME,
openStreamRequestId)
- try {
- 0 until files.size() foreach { idx =>
- val pbStreamHandlerOpt = handleReduceOpenStreamInternal(
- client,
- shuffleKey,
- files.get(idx),
- startIndices.get(idx),
- endIndices.get(idx),
- readLocalFlags.get(idx))
- if (pbStreamHandlerOpt.getStatus != StatusCode.SUCCESS.getValue) {
+ val streamHandlerFutures = (0 until files.size()).map { idx =>
+ handleReduceOpenStreamAsync(
+ client,
+ shuffleKey,
+ files.get(idx),
Review Comment:
`PbOpenStreamList` handling builds `streamHandlerFutures` by indexing into
`startIndices`/`endIndices`/`readLocalFlags` using `files.size()`, but there is
no validation that these repeated fields have the same length. If a malformed
request has mismatched sizes, `*.get(idx)` will throw (e.g.,
`IndexOutOfBoundsException`) and this method will exit without stopping the
OPEN_STREAM_TIME timer or sending any RPC failure/response.
--
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]