Skip to content

[16.0] odoo_repository[_migration]: split bloated scan jobs#53

Merged
sebalix merged 3 commits intoOCA:16.0from
sebalix:16-split-bloated-scan-jobs
Sep 27, 2024
Merged

[16.0] odoo_repository[_migration]: split bloated scan jobs#53
sebalix merged 3 commits intoOCA:16.0from
sebalix:16-split-bloated-scan-jobs

Conversation

@sebalix
Copy link
Copy Markdown
Collaborator

@sebalix sebalix commented Sep 23, 2024

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 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.

These commits are splitting RepositoryScanner and MigrationScanner jobs 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.

@sebalix sebalix force-pushed the 16-split-bloated-scan-jobs branch 3 times, most recently from 0e8fd3d to 7911b5c Compare September 24, 2024 08:10
@sebalix sebalix marked this pull request as ready for review September 24, 2024 08:13
Copy link
Copy Markdown
Collaborator Author

@sebalix sebalix Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sebalix force-pushed the 16-split-bloated-scan-jobs branch 2 times, most recently from a53a39a to 7b8f20d Compare September 24, 2024 15:45
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.
@sebalix sebalix force-pushed the 16-split-bloated-scan-jobs branch from 41971a4 to af6ac01 Compare September 25, 2024 12:39
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.
@sebalix sebalix force-pushed the 16-split-bloated-scan-jobs branch from af6ac01 to 4351b82 Compare September 26, 2024 07:41
@sebalix sebalix merged commit 9d198e9 into OCA:16.0 Sep 27, 2024
@sebalix sebalix deleted the 16-split-bloated-scan-jobs branch September 27, 2024 08:32
@sebalix sebalix changed the title [16.] odoo_repository[_migration]: split bloated scan jobs [16.0] odoo_repository[_migration]: split bloated scan jobs Oct 17, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant