Skip to content

Stop eager loading dependencies in dependency parsing workers#1072

Merged
andrew merged 2 commits intomainfrom
remove-eager-load-dependencies-workers
Apr 3, 2026
Merged

Stop eager loading dependencies in dependency parsing workers#1072
andrew merged 2 commits intomainfrom
remove-eager-load-dependencies-workers

Conversation

@andrew
Copy link
Copy Markdown
Member

@andrew andrew commented Apr 3, 2026

ParseDependenciesWorker and ParseTagDependenciesWorker used includes(manifests: :dependencies) which loads all dependency rows into memory. The manifests eager load is needed by sync_manifest and delete_old_manifests, but the nested :dependencies load is never read. For repositories with many dependencies this can consume several GB of memory.

Changed to includes(:manifests) to keep the manifests preloaded while avoiding loading dependency rows.

andrew added 2 commits April 3, 2026 11:08
The includes(manifests: :dependencies) call loads all manifests and
dependencies for a repository/tag into memory before parse_dependencies
runs. This data is never used since parse_dependencies fetches fresh
results from the parser API. For repositories with many manifests this
eager load can consume several GB of memory.
The includes(manifests: :dependencies) call loads all dependency rows
into memory but parse_dependencies never reads them. Keep the manifests
eager load since sync_manifest and delete_old_manifests use the loaded
collection, but drop the nested :dependencies to avoid loading
potentially millions of rows.
@andrew andrew changed the title Remove unnecessary eager loading in dependency parsing workers Stop eager loading dependencies in dependency parsing workers Apr 3, 2026
@andrew andrew merged commit 4806527 into main Apr 3, 2026
1 check passed
@andrew andrew deleted the remove-eager-load-dependencies-workers branch April 3, 2026 10:44
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