-
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): Migrate import contentlets action to job processor - Feedback improvements #30617
Merged
jgambarios
merged 21 commits into
main
from
issue-29498-migrate-ImportContentletsAction-to-job-processor-fixes
Nov 13, 2024
Merged
Feat (Core): Migrate import contentlets action to job processor - Feedback improvements #30617
jgambarios
merged 21 commits into
main
from
issue-29498-migrate-ImportContentletsAction-to-job-processor-fixes
Nov 13, 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
Replaced the use of `synchronizedList` with `CopyOnWriteArrayList` for thread safety in `RealTimeJobMonitor`. Simplified content import method by consolidating preview and publish handling into a single method and improved header processing logic for multilingual imports in `ImportContentletsProcessor`.
Introduced JobCancelRequestEvent to handle job cancel requests, and updated JobState to include CANCEL_REQUESTED state. Enhanced logic to support cancellation in JobQueueManagerAPIImpl, including job cancellation exception handling and event notifications.
Implemented caching for job states to improve performance by avoiding redundant database calls. Added new `JobCache` interface and `JobCacheImpl` for job state caching, and integrated it with methods fetching and updating job state and status. Enhanced job progress updates to utilize the new caching logic, and removed redundant job cancellation logic for clarity and efficiency.
Refactor to introduce `findContentType` for content type retrieval and validation. This involves handling cases where content type is not found, adding detailed error messages, and ensuring security checks.
…mportContentletsAction-to-job-processor-fixes
…for the monitor of jobs
…mportContentletsAction-to-job-processor-fixes
…mportContentletsAction-to-job-processor-fixes
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.
left a couple of comments but all in all looks good
dotCMS/src/main/java/com/dotcms/jobs/business/api/events/JobCancelRequestEvent.java
Outdated
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/jobs/business/api/events/RealTimeJobMonitor.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/jobs/business/processor/impl/ImportContentletsProcessor.java
Show resolved
Hide resolved
dotCMS/src/main/java/com/dotcms/jobs/business/processor/impl/ImportContentletsProcessor.java
Show resolved
Hide resolved
fabrizzio-dotCMS
approved these changes
Nov 11, 2024
…mportContentletsAction-to-job-processor-fixes
…mportContentletsAction-to-job-processor-fixes
…mportContentletsAction-to-job-processor-fixes
…mportContentletsAction-to-job-processor-fixes
Quality Gate passedIssues Measures |
nollymar
approved these changes
Nov 13, 2024
github-merge-queue
bot
removed this pull request from the merge queue due to failed status checks
Nov 13, 2024
jgambarios
deleted the
issue-29498-migrate-ImportContentletsAction-to-job-processor-fixes
branch
November 13, 2024 15:38
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 several changes to the job queue management system, focusing on improving the handling of job cancellation requests and updating exception handling. The key changes include the introduction of a new event for job cancellation requests, modifications to exception types for consistency, and enhancements to job state management.
Improvements to job cancellation handling:
JobCancelRequestEvent
class to represent job cancellation requests and handle them appropriately (dotCMS/src/main/java/com/dotcms/jobs/business/api/events/JobCancelRequestEvent.java
).onCancelRequestJob
to handle job cancellation requests and updated thecancelJob
method to use this new method (dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
). [1] [2]Exception handling improvements:
JobQueueDataException
withDotDataException
in various methods to standardize exception handling (dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPI.java
). [1] [2] [3]getActiveJobs
,getCompletedJobs
,getCanceledJobs
, andgetFailedJobs
methods to throwDotDataException
instead ofJobQueueDataException
(dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
). [1] [2]Job state management:
getJobState
to fetch the state of a job and ensure the latest state is used during job progress updates (dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
).handleJobCompletion
method to check if a job has been in a canceling state and update its status accordingly (dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
).Code cleanup and imports:
JobQueueDataException
and added necessary imports for new event handling (dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPI.java
).dotCMS/src/main/java/com/dotcms/jobs/business/api/JobQueueManagerAPIImpl.java
). [1] [2] [3]This PR fixes: #29498