You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/05/31 19:25:23 UTC

[GitHub] [samza] thunderstumpges commented on a change in pull request #1059: surround staging directory cleanup in try/catch

thunderstumpges commented on a change in pull request #1059: surround staging directory cleanup in try/catch
URL: https://github.com/apache/samza/pull/1059#discussion_r289522233
 
 

 ##########
 File path: samza-yarn/src/main/scala/org/apache/samza/job/yarn/YarnJob.scala
 ##########
 @@ -71,8 +71,18 @@ class YarnJob(config: Config, hadoopConfig: Configuration) extends StreamJob {
       )
     } catch {
       case e: Throwable =>
-        client.cleanupStagingDir
-        throw e
+        logger.error("Exception submitting yarn job.", e )
+        try {
+          // try to clean up. this may throw an exception depending on how far into launching the job we got.
+          // we don't want to mask the original problem by throwing this.
+          client.cleanupStagingDir
+        }
+        catch {
 
 Review comment:
   Sure thing. Done.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services