-
Notifications
You must be signed in to change notification settings - Fork 748
[GOBBLIN-2193] Fail Azkaban job on Temporal Job Failure #4096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iPalash
wants to merge
10
commits into
apache:master
Choose a base branch
from
iPalash:fail_azkaban_job_on_gaas_failure
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b17f3dd
Fail Azkaban job on GaaS Job Failure
3bac719
update test for YarnService
ba88388
Add docstring for JobFailureEvent
4fd615d
Checkstyle errors and redundant line remove
a449483
review comments
d898960
review changes
17d12ae
import ordeR
849991f
replace fields with object
bb1a8f3
update test
d23ef07
remove unused import
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/event/JobFailureEvent.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package org.apache.gobblin.cluster.event; | ||
|
|
||
| import lombok.Getter; | ||
| import org.apache.gobblin.runtime.JobState; | ||
|
|
||
|
|
||
| /** | ||
| * The `JobFailureEvent` class represents an event that is triggered when a job fails. | ||
| * It contains information about the job state and a summary of the issues that caused the failure. | ||
| */ | ||
| public class JobFailureEvent { | ||
| @Getter | ||
| private final JobState jobState; | ||
| @Getter | ||
| private final String issuesSummary; | ||
| public JobFailureEvent(JobState jobState, String issuesSummary) { | ||
| this.jobState = jobState; | ||
| this.issuesSummary = issuesSummary; | ||
| } | ||
iPalash marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -230,6 +230,8 @@ public class GobblinYarnAppLauncher { | |
| // This flag tells if the Yarn application has already completed. This is used to | ||
| // tell if it is necessary to send a shutdown message to the ApplicationMaster. | ||
| private volatile boolean applicationCompleted = false; | ||
| private final Object applicationDone = new Object(); | ||
| private volatile boolean applicationFailed = false; | ||
|
|
||
| private volatile boolean stopped = false; | ||
|
|
||
|
|
@@ -380,6 +382,19 @@ public void launch() throws IOException, YarnException, InterruptedException { | |
| }, 0, this.appReportIntervalMinutes, TimeUnit.MINUTES); | ||
|
|
||
| addServices(); | ||
|
|
||
| synchronized (this.applicationDone) { | ||
| while (!this.applicationCompleted) { | ||
| try { | ||
| this.applicationDone.wait(); | ||
|
Comment on lines
+389
to
+392
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it might be simpler and cleaner to use |
||
| if (this.applicationFailed) { | ||
| throw new RuntimeException("Gobblin Yarn application failed"); | ||
| } | ||
| } catch (InterruptedException ie) { | ||
| LOGGER.error("Interrupted while waiting for the Gobblin Yarn application to finish", ie); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throw exception? |
||
| } | ||
| } | ||
| } | ||
iPalash marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| public boolean isApplicationRunning() { | ||
|
|
@@ -453,7 +468,6 @@ public synchronized void stop() throws IOException, TimeoutException { | |
| this.closer.close(); | ||
| } | ||
| } | ||
|
|
||
| this.stopped = true; | ||
| } | ||
|
|
||
|
|
@@ -482,9 +496,15 @@ public void handleApplicationReportArrivalEvent(ApplicationReportArrivalEvent ap | |
| LOGGER.info("Gobblin Yarn application finished with final status: " + | ||
| applicationReport.getFinalApplicationStatus().toString()); | ||
| if (applicationReport.getFinalApplicationStatus() == FinalApplicationStatus.FAILED) { | ||
| applicationFailed = true; | ||
| LOGGER.error("Gobblin Yarn application failed for the following reason: " + applicationReport.getDiagnostics()); | ||
| } | ||
|
|
||
| synchronized (this.applicationDone) { | ||
| this.applicationDone.notify(); | ||
| } | ||
|
|
||
|
|
||
| try { | ||
| GobblinYarnAppLauncher.this.stop(); | ||
| } catch (IOException ioe) { | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.