Project

Profile

Help

Issue #6534

Having same content in one batch can cause issues in _post_save of ContentSaver

Added by ttereshc 5 months ago. Updated 5 months ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

ContentSaver lets the duplicated content from one batch to be processed in the _post_save. It can cause issues, I'm not sure if duplicates bring any benefit.

Imagine 2 same content units in one batch. According to the code here:

  • first declarative content is fully processed
  • second declarative content falls under IntegrityError, it now has the same content associated with it, and further processing of this stage is not happening BUT...
  • ... the whole batch (2 declarative content units) is then getting processed by the _post_save

The purpose of the _post_save method (to my understanding) is to perform some additional actions, usually db operations, to make a piece of content complete or perform something essential after each content is saved.

Currently, in RPM plugin we run into the issue that those essential operations are performed twice for a content unit if there are 2 same content units in a batch. This is an undesirable behaviour.

It can be fixed in each plugin in a _post_save if they have it, or maybe it's worth fixing it in the stages in pulpcore.

History

#1 Updated by fao89 5 months ago

  • Triaged changed from No to Yes

Please register to edit this issue

Also available in: Atom PDF