You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Task diagnostic/profile artifacts are stored in the default domain, not the task's domain #8401
When a task runs in a non-default domain and task diagnostics are enabled (TASK_DIAGNOSTICS / the X-Task-Diagnostics header), the resulting profile artifacts are created without the task's domain context, so they are stored in the default domain instead of the task's pulp_domain.
Where
pulpcore/tasking/_util.py — the diagnostic decorators create the Artifact and ProfileArtifact outside any with_domain(...) context:
artifact=Artifact.init_and_validate(...)
artifact.save() # on IntegrityError: artifact = Artifact.objects.get(sha256=artifact.sha256)ProfileArtifact.objects.get_or_create(artifact=artifact, name=..., task=task)
Artifact and ProfileArtifact are domain-scoped, but these run in the worker without the task's domain active, so they land in default. The IntegrityError dedup fallback (Artifact.objects.get(sha256=...)) is also not domain-scoped and can return a different domain's artifact.
Impact
On domain-enabled deployments, profile artifacts for tasks in non-default domains are misfiled in the default domain (and may be cross-domain deduplicated), which affects retrieval via the task profile_artifacts endpoint.
Suggested fix
Wrap each artifact + ProfileArtifact creation in with_domain(task.pulp_domain) (already imported in _util.py) and scope the dedup lookup with pulp_domain=task.pulp_domain.
Version
Confirmed on 3.123.1 and still present on current main (3.125.x).
Note
A downstream deployment (pulp-service) carries a local patch that fixes this for pyinstrument and memray only; a complete upstream fix should also cover memory and task_logs.
Activity
Store task diagnostics in the task domain
Store task diagnostics in the task domain
Store task diagnostics in the task domain
Store task diagnostics in the task domain