akpatnam25 commented on code in PR #2064:
URL:
https://github.com/apache/incubator-celeborn/pull/2064#discussion_r1387670809
##########
worker/src/main/scala/org/apache/celeborn/service/deploy/worker/PushDataHandler.scala:
##########
@@ -821,28 +807,11 @@ class PushDataHandler(val workerSource: WorkerSource)
extends BaseMessageHandler
// for primary, send data to replica
if (location.hasPeer && isPrimary) {
- // to do
- wrappedCallback.onSuccess(ByteBuffer.wrap(Array[Byte]()))
- } else {
- wrappedCallback.onSuccess(ByteBuffer.wrap(Array[Byte]()))
- }
-
- try {
- fileWriter.write(body)
- } catch {
- case e: AlreadyClosedException =>
- fileWriter.decrementPendingWrites()
- val (mapId, attemptId) = getMapAttempt(body)
- val endedAttempt =
- if (shuffleMapperAttempts.containsKey(shuffleKey)) {
- shuffleMapperAttempts.get(shuffleKey).get(mapId)
- } else -1
- // TODO just info log for ended attempt
- logError(
- s"[handleMapPartitionPushData] Append data failed for task(shuffle
$shuffleKey, map $mapId, attempt" +
- s" $attemptId), caused by AlreadyClosedException, endedAttempt
$endedAttempt, error message: ${e.getMessage}")
- case e: Exception =>
- logError("Exception encountered when write.", e)
+ writeDataWithExceptionHandling(fileWriter, body, shuffleKey).onComplete {
+ case Success(_) =>
wrappedCallback.onSuccess(ByteBuffer.wrap(Array[Byte]()))
+ // TODO: handle exception
+ case Failure(_) =>
wrappedCallback.onSuccess(ByteBuffer.wrap(Array[Byte]()))
+ }
Review Comment:
updated
--
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]