[16.0] odoo_repository[_migration]: split bloated scan jobs#53
Merged
[16.0] odoo_repository[_migration]: split bloated scan jobs#53
Conversation
0e8fd3d to
7911b5c
Compare
sebalix
commented
Sep 24, 2024
odoo_repository/lib/scanner.py
Outdated
Collaborator
Author
There was a problem hiding this comment.
This is calling git log and this is quite time/IO consuming in repo such as odoo/odoo. When we call _get_module_paths or _get_module_paths_updated to detect the modules to scan, we don't need the last commit of each module yet, we wait the scan job to retrieve it otherwise the detection of modules to update could take hours on the first scan of odoo/odoo (and the job gets killed before).
sebalix
commented
Sep 24, 2024
a53a39a to
7b8f20d
Compare
RepositoryScanner jobs could be quite long to execute on a repository (like 'odoo/odoo'), and depending on your Odoo config or your monitoring tools, such job could get killed before it ends up its work. While there is no issue to get the RepositoryScanner job killed and restarted later, it'll re-analyze the branch to scan to detect again the modules it has to scan, and this process itself could take ages before it re-starts the scan of the modules themselves. This commit is splitting these two tasks: - one job to detect modules to scan for a given repository/branch - one job created for each module to scan All of these jobs are depending on each other so we ensure that they are run sequentially (one branch after another, and one module after another) so only one job is running for a given repository at a time. We also ensure that no more than one job can be spawned by the user from UI. This results in a higher number of jobs, but scanning can be recovered easily.
41971a4 to
af6ac01
Compare
MigrationScanner jobs could be quite long to execute on some repositories, and depending on your Odoo config or your monitoring tools, such job could get killed before it ends up its work. This commit is splitting these two tasks: - one job to scan a migration path for a given repository (that will create one job per module needing a migration scan) - one job created for each module to scan Migration scan jobs depends on the last repository scan job, as we need this one to be finished to know the list of modules that would need a migration scan.
af6ac01 to
4351b82
Compare
sebalix
referenced
this pull request
in sebalix/module-composition-analysis2
Nov 19, 2024
…n path And change the method/button 'action_force_scan' to 'action_scan'. Thanks to the new way jobs are spawned (PR #53) and the new `<odoo.module.branch>.migration_scan` flag, there is no need to reset the last scanned commits to perform a migration scan on relevant modules, preserving a lot of computation time and resources.
sebalix
added a commit
to sebalix/module-composition-analysis
that referenced
this pull request
Mar 30, 2026
…n path And change the method/button 'action_force_scan' to 'action_scan'. Thanks to the new way jobs are spawned (PR OCA#53) and the new `<odoo.module.branch>.migration_scan` flag, there is no need to reset the last scanned commits to perform a migration scan on relevant modules, preserving a lot of computation time and resources.
This file contains hidden or 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
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.
Jobs could be quite long to execute on a repository (like 'odoo/odoo'), and depending on your Odoo config or your monitoring tools, such job could get killed before it ends up its work.
While there is no issue to get the a
RepositoryScannerjob killed andrestarted later, it'll re-analyze the branch to scan to detect again the
modules it has to scan, and this process itself could take ages before
it re-starts the scan of the modules themselves.
These commits are splitting
RepositoryScannerandMigrationScannerjobs in several, smaller jobs so we reduce the time needed for each of them.This results in a higher number of jobs, but scanning can be recovered easily.