Skip to content
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

[oc] log the job that is cancelled when pruning zombie jobs #8514

Merged
merged 1 commit into from
Dec 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
log the job that is cancelled when pruning zombie jobs
  • Loading branch information
cgardens committed Dec 5, 2021
commit aab9deeaff15682c2e42c81ada4087a88d8f749a
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ public void start() throws IOException {
private void cleanupZombies(final JobPersistence jobPersistence, final JobNotifier jobNotifier) throws IOException {
for (final Job zombieJob : jobPersistence.listJobsWithStatus(JobStatus.RUNNING)) {
jobNotifier.failJob("zombie job was cancelled", zombieJob);
LOGGER.warn(
"zombie clean up - job was cancelled. job id: {}, type: {}, scope: {}",
zombieJob.getId(),
zombieJob.getConfigType(),
zombieJob.getScope());

jobPersistence.cancelJob(zombieJob.getId());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ public TemporalCancellationHandler() {
@Override
public void checkAndHandleCancellation(final Runnable onCancellationCallback) {
try {
// Heartbeat is somewhat misleading here. What it does is check the current Temporal activity's
// context and
// throw an exception if the sync has been cancelled or timed out. The input to this heartbeat
// function
// is available as a field in thrown ActivityCompletionExceptions, which we aren't using for now.
/*
* Heartbeat is somewhat misleading here. What it does is check the current Temporal activity's
* context and throw an exception if the sync has been cancelled or timed out. The input to this
* heartbeat function is available as a field in thrown ActivityCompletionExceptions, which we
* aren't using for now.
*/
context.heartbeat(null);
} catch (final ActivityCompletionException e) {
onCancellationCallback.run();
Expand Down