[PR #7896/d57f7275 backport][3.105] Narrow distribution locks with safe base_path protection - #7955
Merged
mdellweg merged 1 commit intoAug 11, 2026
Conversation
mdellweg
previously approved these changes
Aug 11, 2026
Member
|
The lb test is failing because pytest-django 4.14.0 is installed, while 4.13.0 dropped support for Django 4.2. How this incompatible combination of versions could ever have been installed is beyond my comprehension. |
mdellweg
force-pushed
the
patchback/backports/3.105/d57f7275e4fb599f5488fe207fb1c8ae4472f4f5/pr-7896
branch
from
August 11, 2026 12:22
a52bc75 to
54d8de5
Compare
Reserve per-distribution locks for ordinary updates while serializing creates and base_path changes on a dedicated domain-scoped distribution.base_path resource. Keep the legacy domain:distributions reservation in shared mode for mixed-version upgrade safety, and move the shared-resource plumbing into the generic async mixins so publication.py only defines the distribution-specific lock policy. Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit d57f727)
mdellweg
force-pushed
the
patchback/backports/3.105/d57f7275e4fb599f5488fe207fb1c8ae4472f4f5/pr-7896
branch
from
August 11, 2026 12:32
54d8de5 to
47f4a43
Compare
mdellweg
approved these changes
Aug 11, 2026
mdellweg
deleted the
patchback/backports/3.105/d57f7275e4fb599f5488fe207fb1c8ae4472f4f5/pr-7896
branch
August 11, 2026 14:04
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.
This is a backport of PR #7896 as merged into main (d57f727).
Problem
Async distribution CUD operations currently reserve the domain-wide
pdrn:<domain>:distributionsresource too broadly. For ordinary updatesthat leave
base_pathunchanged, this serializes unrelatedpulpcore.app.tasks.base.ageneral_updatetasks behind a lock they do notneed.
This showed up as a bottleneck during capsule sync, where many
RefreshDistributionupdates can run at once but end up waiting on thesame reservation.
What this changes
This patch narrows distribution task reservations while keeping the
base_pathnamespace protected in the safer way discussed in review:base_pathunchanged reserve only thedistribution instance
base_pathalsoreserve a dedicated domain-scoped
distribution.base_pathresourcedistribution.base_pathlockdomain:distributionsreservation is still added in sharedmode for mixed-version upgrade compatibility
The implementation also handles partial
PATCHrequests correctly byfalling back to
instance.base_pathwhenbase_pathis omitted from therequest body.
As part of the final cleanup, the
shared_resourcesplumbing now lives inthe generic async mixins in
base.py, whilepublication.pyonly definesthe distribution-specific lock policy.
Test coverage
Adds a functional test covering the reservation behavior for:
base_pathin the payloadbase_pathbase_pathPerformance notes
Tested with Satellite 6.20 Stream,
~175 capsules, 15 Pulp workers.
For completed
pulpcore.app.tasks.base.ageneral_updatetasks, lock usageshifted from all domain-wide reservations to a mix of domain and
instance-scoped reservations:
Block wait times improved substantially:
These results are consistent with removing unnecessary serialization for
ordinary distribution updates while preserving explicit protection when the
base_pathnamespace can change.