Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
emit shuffle pod watch exception
Browse files Browse the repository at this point in the history
Signed-off-by: forrestchen <[email protected]>
  • Loading branch information
ChenLingPeng committed Jan 24, 2018
1 parent d7dd259 commit 2026c68
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,14 @@ private[spark] class KubernetesExternalShuffleManagerImpl(
}

private def addShufflePodToCache(pod: Pod): Unit = shufflePodCache.synchronized {
if (shufflePodCache.contains(pod.getSpec.getNodeName)) {
val registeredPodName = shufflePodCache.get(pod.getSpec.getNodeName).get
logError(s"Ambiguous specification of shuffle service pod. " +
s"Found multiple matching pods: ${pod.getMetadata.getName}, " +
s"${registeredPodName} on ${pod.getSpec.getNodeName}")

throw new SparkException(s"Ambiguous specification of shuffle service pod. " +
s"Found multiple matching pods: ${pod.getMetadata.getName}, " +
s"${registeredPodName} on ${pod.getSpec.getNodeName}")
} else {
shufflePodCache(pod.getSpec.getNodeName) = pod.getStatus.getPodIP
if (shufflePodCache.exists(kv => kv._1 == pod.getSpec.getNodeName
&& kv._2 != pod.getStatus.getPodIP)) {
val registeredPodIP = shufflePodCache(pod.getSpec.getNodeName)
logWarning(s"Ambiguous specification of shuffle service pod. " +
s"Found multiple matching pods: ${pod.getMetadata.getName}(${pod.getStatus.getPodIP}), " +
s"$registeredPodIP on ${pod.getSpec.getNodeName}, will update")
}
shufflePodCache(pod.getSpec.getNodeName) = pod.getStatus.getPodIP
}

override def stop(): Unit = {
Expand Down

0 comments on commit 2026c68

Please sign in to comment.