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

✨ [Job Engine] Added JobDataCleanupJobEndCallback to delete JobInstanceData after JobExecution has ended #4150

Merged
merged 2 commits into from
Dec 12, 2024

Conversation

Coduz
Copy link
Contributor

@Coduz Coduz commented Dec 5, 2024

This PR adds a JobDataCleanupJobEndCallback to remove data of the JobInstance after the JobExecution has run.

This will avoid the jbtc_* tables to group up in size and row count making some operations being slow (eg: checking if a Job is running when is has a lot of Execution.

Related Issue
None

Description of the solution adopted
Leverage the IJobEndCallbackService to extend the default JobEndCallbackManagerImpl and register a custom JobEndCallback that deletes data

Screenshots
None

Any side note on the changes made
Perhaps, also the check for queued job should be moved to a JobEndCallback. Unfortunately only parameter given to the JobEndCallback is the jBatch jobExecutionId, which makes difficult to check which is the actual Kapua JobExecution that was running and start enqueued Jobs

…ceData after JobExecution has ended

Signed-off-by: Alberto Codutti <[email protected]>
@Coduz Coduz added the Enhancement This PR/Issue improves an part of Kapua label Dec 5, 2024
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.76%. Comparing base (38c4367) to head (0335034).
Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4150      +/-   ##
=============================================
- Coverage      16.79%   16.76%   -0.03%     
  Complexity        22       22              
=============================================
  Files           2037     2037              
  Lines          52835    52835              
  Branches        4441     4441              
=============================================
- Hits            8874     8860      -14     
- Misses         43560    43572      +12     
- Partials         401      403       +2     

see 3 files with indirect coverage changes

… be refactored in a future PR

Signed-off-by: Alberto Codutti <[email protected]>
@Coduz Coduz force-pushed the feat-jobInstanceDataJobEndCallback branch from 693a62b to 0335034 Compare December 12, 2024 09:19
@Coduz Coduz merged commit ca9f887 into eclipse:develop Dec 12, 2024
35 of 36 checks passed
@Coduz Coduz deleted the feat-jobInstanceDataJobEndCallback branch December 12, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This PR/Issue improves an part of Kapua
Projects
Development

Successfully merging this pull request may close these issues.

1 participant