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

MINOR: chore(apps): reset error triggers on schedule #19606

Merged
merged 1 commit into from
Feb 5, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.openmetadata.common.utils.CommonUtil;
Expand Down Expand Up @@ -94,12 +97,17 @@ private AppScheduler(
.getListenerManager()
.addJobListener(new OmAppJobListener(dao), jobGroupEquals(APPS_JOB_GROUP));

this.resetErrorTriggers();
ScheduledExecutorService threadScheduler = Executors.newScheduledThreadPool(1);
threadScheduler.scheduleAtFixedRate(this::resetErrorTriggers, 0, 24, TimeUnit.HOURS);

// Start Scheduler
this.scheduler.start();
}

/* Quartz triggers can go into an "ERROR" state in some cases. Most notably when the jobs
constructor throws an error. I do not know why this happens and the issues seem to be transient.
This method resets all triggers in the ERROR state to the normal state.
*/
private void resetErrorTriggers() {
try {
scheduler
Expand Down
Loading