Ngone51 commented on a change in pull request #31876:
URL: https://github.com/apache/spark/pull/31876#discussion_r615948717



##########
File path: core/src/main/scala/org/apache/spark/util/JsonProtocol.scala
##########
@@ -439,7 +439,14 @@ private[spark] object JsonProtocol {
     val reason = Utils.getFormattedClassName(taskEndReason)
     val json: JObject = taskEndReason match {
       case fetchFailed: FetchFailed =>
-        val blockManagerAddress = Option(fetchFailed.bmAddress).
+        val blockManagerAddress = Option {
+          fetchFailed.bmAddress match {
+            case bmId: BlockManagerId =>
+              bmId
+            case _ =>
+              // TODO: support custom locations
+              null
+          }}.
           map(blockManagerIdToJson).getOrElse(JNothing)
         ("Block Manager Address" -> blockManagerAddress) ~

Review comment:
       I'm think of replacing `("Block Manager Address" -> 
blockManagerAddress)` with ("custom location name" -> locationString) when the 
`bmAddress` is a custom location. Thus, we'd be able to log custom location as 
well as keep the backward compatibility unless users log the custom location 
but read it uses old version. 




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to