-
Notifications
You must be signed in to change notification settings - Fork 467
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
Feat (Core): Implement abandoned job detection and recovery #30710
Merged
jgambarios
merged 13 commits into
main
from
issue-30367-Implement-Abandoned-Job-Detection-and-Recovery
Nov 21, 2024
Merged
Feat (Core): Implement abandoned job detection and recovery #30710
jgambarios
merged 13 commits into
main
from
issue-30367-Implement-Abandoned-Job-Detection-and-Recovery
Nov 21, 2024
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
…dded `JobEvent` interface to various job event classes and implemented validation logic in `ImportContentletsProcessor`. Introduced the `AbandonedJobDetector` class for detecting and handling abandoned jobs.
…s in transaction handling on the JobQueueManagerAPIImpl
…-Abandoned-Job-Detection-and-Recovery
…-Abandoned-Job-Detection-and-Recovery
…-Abandoned-Job-Detection-and-Recovery
fabrizzio-dotCMS
approved these changes
Nov 20, 2024
dotCMS/src/main/java/com/dotcms/jobs/business/queue/PostgresJobQueue.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/jobs/business/detector/AbandonedJobDetectorConfigProducer.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/jobs/business/detector/AbandonedJobDetectorConfigProducer.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/jobs/business/detector/AbandonedJobDetectorConfig.java
Show resolved
Hide resolved
…-Abandoned-Job-Detection-and-Recovery
This change updates the detectAndMarkAbandoned method to return an Optional<Job> instead of null. This helps to avoid potential NullPointerExceptions and improves code readability. Corresponding updates were made to the affected classes and integration tests to handle the Optional return type appropriately.
nollymar
reviewed
Nov 20, 2024
dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
Show resolved
Hide resolved
nollymar
approved these changes
Nov 20, 2024
…onfig A protected no-arg constructor was added to AbandonedJobDetectorConfig to comply with CDI requirements. This ensures the class can be properly proxied and managed by the CDI container.
…-Abandoned-Job-Detection-and-Recovery
Quality Gate passedIssues Measures |
jgambarios
deleted the
issue-30367-Implement-Abandoned-Job-Detection-and-Recovery
branch
November 21, 2024 02:01
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.
This pull request includes some refactoring and improvements to the job queue management system.
The changes primarily focus on removing the job polling mechanism, enhancing job validation, and adding an abandoned job detector. Below are the most important changes:
Removal of Job Polling Mechanism:
dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueConfig.java
: Removed thepollJobUpdatesIntervalMilliseconds
parameter and its associated methods. [1] [2]dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueConfigProducer.java
: Removed the default polling interval configuration and its usage. [1] [2]dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
: Removed the polling scheduler and related methods. [1] [2]Addition of Abandoned Job Detector:
dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
: AddedAbandonedJobDetector
as a dependency and integrated it into the job queue lifecycle methods. [1] [2] [3] [4] [5]Enhancements to Job Validation:
dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
: Added validation for job parameters if the processor implementsValidator
and handled validation exceptions.Event Handling Improvements:
dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
: Replaced direct event firing withJobUtil.sendEvents
for better event management. [1] [2] [3] [4] [5]Miscellaneous Changes:
dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
: Adjusted the job progress update interval from 2 to 3 seconds.This PR fixes: #30367