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

    https://github.com/apache/flink/pull/3981#discussion_r118304278
  
    --- Diff: 
flink-yarn/src/main/scala/org/apache/flink/yarn/YarnJobManager.scala ---
    @@ -89,5 +92,37 @@ class YarnJobManager(
           
flinkConfiguration.getInteger(ConfigConstants.YARN_HEARTBEAT_DELAY_SECONDS, 5),
           TimeUnit.SECONDS)
     
    +  val yarnFilesPath: Option[String] = 
Option(System.getenv().get(YarnConfigKeys.FLINK_YARN_FILES))
    +
       override val jobPollingInterval = YARN_HEARTBEAT_DELAY
    +
    +  override def handleMessage: Receive = {
    +    handleYarnShutdown orElse super.handleMessage
    +  }
    +
    +  def handleYarnShutdown: Receive = {
    +    case msg:StopCluster =>
    +      super.handleMessage(msg)
    +
    +      // do global cleanup if the yarn files path has been set
    +      yarnFilesPath match {
    +        case Some(filePath) =>
    +          log.info(s"Deleting yarn application files under $filePath.")
    +
    +          val path = new Path(filePath)
    +
    +          try {
    +            val fs = path.getFileSystem
    +            fs.delete(path, true)
    --- End diff --
    
    Please check the return value from delete() call


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to