Github user JoshRosen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7602#discussion_r35560011
  
    --- Diff: 
core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala ---
    @@ -181,17 +181,27 @@ private[ui] object RDDOperationGraph extends Logging {
       }
     
       /** Return the dot representation of a subgraph in an RDDOperationGraph. 
*/
    -  private def makeDotSubgraph(cluster: RDDOperationCluster, indent: 
String): String = {
    +  private def makeDotSubgraph(cluster: RDDOperationCluster, indent: 
StringBuilder): String = {
         val subgraph = new StringBuilder
    -    subgraph.append(indent + s"subgraph cluster${cluster.id} {\n")
    -    subgraph.append(indent + s"""  label="${cluster.name}";\n""")
    -    cluster.childNodes.foreach { node =>
    -      subgraph.append(indent + s"  ${makeDotNode(node)};\n")
    -    }
    -    cluster.childClusters.foreach { cscope =>
    -      subgraph.append(makeDotSubgraph(cscope, indent + "  "))
    +    try {
    +      subgraph.append(indent).append(s"subgraph cluster${cluster.id} {\n")
    +      subgraph.append(indent).append(s"""  label="${cluster.name}";\n""")
    +      cluster.childNodes.foreach { node =>
    +        subgraph.append(indent).append(s"  ${makeDotNode(node)};\n")
    +      }
    +      cluster.childClusters.foreach { cscope =>
    +        subgraph.append(makeDotSubgraph(cscope, indent.append("  ")))
    +      }
    +      subgraph.append(indent).append("}\n")
    +      subgraph.toString()
    +    } catch {
    +      case oom: OutOfMemoryError =>
    +        logError(s"Failed to create graph for job in $cluster.id. Not 
enough heap space.")
    +        throw new SparkException(s"Failed to create graph for job in 
$cluster.id. " +
    +          s"Not enough heap space.")
    +      case _: Exception =>
    --- End diff --
    
    Similarly, this catch statement seems overly-broad.  Returning an empty 
string in the case of an error doesn't make sense to me.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to