-
Notifications
You must be signed in to change notification settings - Fork 751
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
[GOBBLIN-2194] Close temporal metrics scope on job completion #4097
Merged
abhishekmjain
merged 4 commits into
apache:master
from
abhishekmjain:temporal-metrics-closure-fix
Feb 17, 2025
Merged
[GOBBLIN-2194] Close temporal metrics scope on job completion #4097
abhishekmjain
merged 4 commits into
apache:master
from
abhishekmjain:temporal-metrics-closure-fix
Feb 17, 2025
Conversation
This file contains 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
6aed406
to
feb870c
Compare
feb870c
to
8a48450
Compare
Blazer-007
reviewed
Feb 14, 2025
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/joblauncher/GobblinJobLauncher.java
Outdated
Show resolved
Hide resolved
iPalash
reviewed
Feb 14, 2025
...in-temporal/src/main/java/org/apache/gobblin/temporal/cluster/GobblinTemporalTaskRunner.java
Outdated
Show resolved
Hide resolved
...poral/src/main/java/org/apache/gobblin/temporal/joblauncher/GobblinTemporalJobScheduler.java
Outdated
Show resolved
Hide resolved
...poral/src/main/java/org/apache/gobblin/temporal/joblauncher/GobblinTemporalJobScheduler.java
Outdated
Show resolved
Hide resolved
...mporal/src/main/java/org/apache/gobblin/temporal/joblauncher/GobblinTemporalJobLauncher.java
Outdated
Show resolved
Hide resolved
...in-temporal/src/main/java/org/apache/gobblin/temporal/cluster/GobblinTemporalTaskRunner.java
Outdated
Show resolved
Hide resolved
...in-temporal/src/main/java/org/apache/gobblin/temporal/cluster/GobblinTemporalTaskRunner.java
Outdated
Show resolved
Hide resolved
iPalash
reviewed
Feb 14, 2025
...src/main/java/org/apache/gobblin/temporal/workflows/service/ManagedWorkflowServiceStubs.java
Show resolved
Hide resolved
...mporal/src/main/java/org/apache/gobblin/temporal/joblauncher/GobblinTemporalJobLauncher.java
Show resolved
Hide resolved
@@ -137,13 +137,9 @@ public GobblinJobLauncher(Properties jobProps, Path appWorkDir, | |||
@Override | |||
public void close() throws IOException { | |||
try { | |||
executeCancellation(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on what documentation you feel should be added?
The executeCancellation
is a No-Op function implemented in GobblinJobLauncher
468b824
to
27ae5c7
Compare
27ae5c7
to
cd1e492
Compare
...src/main/java/org/apache/gobblin/temporal/workflows/service/ManagedWorkflowServiceStubs.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/gobblin/temporal/workflows/service/ManagedWorkflowServiceStubs.java
Outdated
Show resolved
Hide resolved
khandelwal-prateek
approved these changes
Feb 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
Description
As part of #4095, a bug was introduced where the Metrics Scope object was not being closed, resulting in a non-daemon thread being alive. This resulted in AM container not getting shut down on application completion.
This PR implements the fix to close metrics scope wherever it is initialized.
It also covers calling close on JobLauncher upon its completion, which now results in cleanly closing the resources launched by JobLauncher.
Instead of calling
executeCancellation()
directly we now callcancelJob()
inGobblinJobLauncher.close()
since the latter cancels the job in synchronized manner which in turn callsexecuteCancellation()
.Tests
Tested in a local project where the application master shuts down.
ApplicationLauncher has already stopped
gets printed when the shutdown hook gets called from ServiceBasedAppLauncher indicating a JVM shutdown.Having the same state as the AM shutdown container fix PR. See the Tests section here.
Commits