You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/10/28 23:03:33 UTC

[GitHub] [incubator-gobblin] jack-moseley opened a new pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

jack-moseley opened a new pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141


   Dear Gobblin maintainers,
   
   Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
   
   
   ### JIRA
   - [x] My PR addresses the following [Gobblin JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references them in the PR title. For example, "[GOBBLIN-XXX] My Gobblin PR"
       - https://issues.apache.org/jira/browse/GOBBLIN-1303
   
   
   ### Description
   - [x] Here are some details about my PR, including screenshots (if applicable):
   Currently if there is a failure in cleanupStagingData, it is not caught, so the rest of launchJob (which includes sending GobblinTrackingEvents) will not be run
   
   ### Tests
   - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   trivial
   
   ### Commits
   - [x] My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)":
       1. Subject is separated from body by a blank line
       2. Subject is limited to 50 characters
       3. Subject does not end with a period
       4. Subject uses the imperative mood ("add", not "adding")
       5. Body wraps at 72 characters
       6. Body explains "what" and "why", not "how"
   
   


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



[GitHub] [incubator-gobblin] arjun4084346 commented on a change in pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
arjun4084346 commented on a change in pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#discussion_r514631495



##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
##########
@@ -535,7 +535,11 @@ public WorkUnit apply(@Nullable WorkUnit input) {
       } finally {
         try {
           TimingEvent jobCleanupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.LauncherTimings.JOB_CLEANUP);
-          cleanupStagingData(jobState);
+          try {
+            cleanupStagingData(jobState);
+          } catch (Throwable t) {
+            LOG.error("Failed to clean up staging data", t);

Review comment:
       Got it. Yes 542 is the right place.




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



[GitHub] [incubator-gobblin] jack-moseley commented on a change in pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on a change in pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#discussion_r514625102



##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
##########
@@ -535,7 +535,11 @@ public WorkUnit apply(@Nullable WorkUnit input) {
       } finally {
         try {
           TimingEvent jobCleanupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.LauncherTimings.JOB_CLEANUP);
-          cleanupStagingData(jobState);
+          try {
+            cleanupStagingData(jobState);
+          } catch (Throwable t) {
+            LOG.error("Failed to clean up staging data", t);

Review comment:
       Actually not sure if that's the correct place for it either, because if there is an error when notifying listeners, then the cleanup code to close the metrics reporting wouldn't run. Maybe it should be in the finally block at line 542




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



[GitHub] [incubator-gobblin] asfgit closed pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141


   


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



[GitHub] [incubator-gobblin] arjun4084346 commented on a change in pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
arjun4084346 commented on a change in pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#discussion_r513840447



##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
##########
@@ -535,7 +535,11 @@ public WorkUnit apply(@Nullable WorkUnit input) {
       } finally {
         try {
           TimingEvent jobCleanupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.LauncherTimings.JOB_CLEANUP);
-          cleanupStagingData(jobState);
+          try {
+            cleanupStagingData(jobState);
+          } catch (Throwable t) {
+            LOG.error("Failed to clean up staging data", t);

Review comment:
       But this change will swallow the exception and any errors in `cleanupStagingData` will not fail the job and hence will go undetected (even if there is log message). 
   Should we rather move the code we want to run (sending GTEs) to the finally block at line 600?




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



[GitHub] [incubator-gobblin] jack-moseley commented on a change in pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on a change in pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#discussion_r514628565



##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
##########
@@ -535,7 +535,11 @@ public WorkUnit apply(@Nullable WorkUnit input) {
       } finally {
         try {
           TimingEvent jobCleanupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.LauncherTimings.JOB_CLEANUP);
-          cleanupStagingData(jobState);
+          try {
+            cleanupStagingData(jobState);
+          } catch (Throwable t) {
+            LOG.error("Failed to clean up staging data", t);

Review comment:
       Actually isn't this kind of the normal behaviour for a failed job? Any exception in work unit creation is caught at line 530 and not rethrown, does the job not failed for those cases either?




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



[GitHub] [incubator-gobblin] jack-moseley commented on pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#issuecomment-721975646


   @sv2000 please merge


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



[GitHub] [incubator-gobblin] arjun4084346 commented on a change in pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
arjun4084346 commented on a change in pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#discussion_r514634673



##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
##########
@@ -535,7 +535,11 @@ public WorkUnit apply(@Nullable WorkUnit input) {
       } finally {
         try {
           TimingEvent jobCleanupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.LauncherTimings.JOB_CLEANUP);
-          cleanupStagingData(jobState);
+          try {
+            cleanupStagingData(jobState);
+          } catch (Throwable t) {
+            LOG.error("Failed to clean up staging data", t);

Review comment:
       Okay, so the current behavior is do not fail the job (just mark the gobblin job as FAILED) when workunit creation fails, or anything in the main try block fails. However, according to the current behavior any exception in `cleanupStagingData` and `notifyListeners` are thrown (i.e. making job fail).
   So, if we want to preserve the same behavior, we should move the code form L565-L599 to finally block at 542, right?
   Why the current behavior treats `cleanupStagingData` failures differently, and whether we should change this behavior is a different question that I am not fully sure about.




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



[GitHub] [incubator-gobblin] jack-moseley commented on a change in pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
jack-moseley commented on a change in pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#discussion_r514618204



##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/AbstractJobLauncher.java
##########
@@ -535,7 +535,11 @@ public WorkUnit apply(@Nullable WorkUnit input) {
       } finally {
         try {
           TimingEvent jobCleanupTimer = this.eventSubmitter.getTimingEvent(TimingEvent.LauncherTimings.JOB_CLEANUP);
-          cleanupStagingData(jobState);
+          try {
+            cleanupStagingData(jobState);
+          } catch (Throwable t) {
+            LOG.error("Failed to clean up staging data", t);

Review comment:
       Sure that's a good point, will change that




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



[GitHub] [incubator-gobblin] arjun4084346 commented on pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
arjun4084346 commented on pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141#issuecomment-720793354


   +1 LGTM


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



[GitHub] [incubator-gobblin] jack-moseley closed pull request #3141: [GOBBLIN-1303] Catch error when failing to clean staging data

Posted by GitBox <gi...@apache.org>.
jack-moseley closed pull request #3141:
URL: https://github.com/apache/incubator-gobblin/pull/3141


   


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