Kalvin2077 commented on code in PR #3829:
URL: https://github.com/apache/celeborn/pull/3829#discussion_r3893077745
##########
client/src/main/scala/org/apache/celeborn/client/ChangePartitionManager.scala:
##########
@@ -90,26 +90,38 @@ class ChangePartitionManager(
batchHandleChangePartitionExecutors.submit {
new Runnable {
override def run(): Unit = {
- val distinctPartitions = {
- val requestSet = inBatchPartitions.get(shuffleId)
- val locksForShuffle = locks.computeIfAbsent(shuffleId,
locksRegisterFunc)
- requests.asScala.map { case (partitionId, request) =>
- locksForShuffle(partitionId %
locksForShuffle.length).synchronized {
- if (!requestSet.contains(partitionId) &&
requests.containsKey(
- partitionId)) {
- requestSet.add(partitionId)
- Some(request.asScala.toArray.maxBy(_.epoch))
- } else {
- None
+ try {
+ val distinctPartitions = {
+ val requestSet = inBatchPartitions.get(shuffleId)
+ val locksForShuffle =
locks.computeIfAbsent(shuffleId, locksRegisterFunc)
+ requests.asScala.map { case (partitionId, request) =>
+ locksForShuffle(partitionId %
locksForShuffle.length).synchronized {
+ if (!requestSet.contains(partitionId) &&
requests.containsKey(
+ partitionId)) {
+ requestSet.add(partitionId)
+ Some(request.asScala.toArray.maxBy(_.epoch))
+ } else {
+ None
+ }
}
- }
- }.filter(_.isDefined).map(_.get).toArray
- }
- if (distinctPartitions.nonEmpty) {
- handleRequestPartitions(
- shuffleId,
- distinctPartitions,
-
lifecycleManager.commitManager.isSegmentGranularityVisible(shuffleId))
+ }.filter(_.isDefined).map(_.get).toArray
+ }
+ if (distinctPartitions.nonEmpty) {
+ handleRequestPartitions(
+ shuffleId,
+ distinctPartitions,
+
lifecycleManager.commitManager.isSegmentGranularityVisible(shuffleId))
+ }
+ } catch {
+ case e: InterruptedException =>
+ logError(
+ s"Batch handle change partition for shuffle
$shuffleId interrupted.",
+ e)
+ throw e
Review Comment:
Rethrowing InterruptedException already terminates the task, so interruption
is not being suppressed. submit records the exceptional completion in its
FutureTask; restoring the flag is needed when the exception is swallowed or
converted, not when it is propagated.
--
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]