Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/8383.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed a race condition during concurrent on-demand downloads where unlinking an already-moved temporary artifact raised FileNotFoundError and aborted client transfers.
6 changes: 5 additions & 1 deletion pulpcore/content/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,11 @@ def _save_artifact(self, download_result, remote_artifact, request=None):
# The file needs to be unlinked because it was not used to create an artifact.
# The artifact must have already been saved while servicing another request for
# the same artifact.
os.unlink(download_result.path)
try:
os.unlink(download_result.path)
except FileNotFoundError:
# Temp file may already be moved to storage before the IntegrityError
pass

if content_artifact._state.adding:
# This is the first time pull-through content was requested.
Expand Down
Loading