Skip to content

Commit

Permalink
add setException for all Throwable
Browse files Browse the repository at this point in the history
  • Loading branch information
zaynt4606 committed Dec 11, 2024
1 parent dec0f31 commit 3f4efdb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ public static Throwable wrapIOExceptionToUnRetryable(Throwable throwable) {
}
}

public static IOException wrapThrowableToIOException(Throwable throwable) {
if (throwable instanceof IOException) {
return (IOException) throwable;
} else {
return new IOException(throwable.getMessage(), throwable);
}
}

public static String stringifyException(Throwable exception) {
if (exception == null) {
return "(null)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.apache.celeborn.common.internal.Logging
import org.apache.celeborn.common.meta.{DiskStatus, TimeWindow}
import org.apache.celeborn.common.metrics.source.{AbstractSource, ThreadPoolSource}
import org.apache.celeborn.common.protocol.StorageInfo
import org.apache.celeborn.common.util.{ThreadUtils, Utils}
import org.apache.celeborn.common.util.{ExceptionUtils, ThreadUtils, Utils}
import org.apache.celeborn.service.deploy.worker.WorkerSource
import org.apache.celeborn.service.deploy.worker.WorkerSource.FLUSH_WORKING_QUEUE_SIZE
import org.apache.celeborn.service.deploy.worker.congestcontrol.CongestionController
Expand Down Expand Up @@ -79,14 +79,9 @@ abstract private[worker] class Flusher(
}
} catch {
case t: Throwable =>
t match {
case exception: IOException =>
task.notifier.setException(exception)
processIOException(
exception,
DiskStatus.READ_OR_WRITE_FAILURE)
case _ =>
}
val e = ExceptionUtils.wrapThrowableToIOException(t)
task.notifier.setException(e)
processIOException(e, DiskStatus.READ_OR_WRITE_FAILURE)
logWarning(s"Flusher-$this-thread-$index encounter exception.", t)
}
lastBeginFlushTime.set(index, -1)
Expand Down

0 comments on commit 3f4efdb

Please sign in to comment.