Project

Profile

Help

Issue #8989

Ensure on_demand content finishes saving before request completes

Added by gerrod 3 months ago. Updated 2 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

With #8980 a race condition was found from a client requesting on_demand content and closing the connection after downloading the content before the artifact was finished being saved to the database. The fix in https://github.com/pulp/pulpcore/pull/1447 ensures that the async save task isn't canceled, but a race condition is still present if a client closes the connection before the save is complete and then requests the artifact from the database. They will see no artifact present despite the fact the artifact is still being saved. The timing for this race condition is pretty tight for most artifacts and probably won't be experienced in any normal workflows.

The solution to remove this race condition is to wait before sending the last_chunk for the StreamedResponse like this https://github.com/pulp/pulpcore/commit/cd76a36ae74f98bb19bebe29a0db3e0879010028. This change would require changes in other plugins that define their own Downloaders and it is possible this condition isn't prevalent enough to warrant the work.

History

#1 Updated by dalley 3 months ago

  • Priority changed from Low to Normal

#2 Updated by dkliban@redhat.com 2 months ago

  • Triaged changed from No to Yes

Please register to edit this issue

Also available in: Atom PDF