Skip to content

Commit

Permalink
Revert "Backport workaround for adding RA cooldown"
Browse files Browse the repository at this point in the history
This reverts commit 5fa9019.
  • Loading branch information
pedro-psb committed Jan 14, 2025
1 parent 5fa9019 commit ad00328
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.

This file was deleted.

5 changes: 0 additions & 5 deletions pulpcore/app/models/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,10 +703,6 @@ class RemoteArtifact(BaseModel, QueryMixin):
sha256 (models.CharField): The expected SHA-256 checksum of the file.
sha384 (models.CharField): The expected SHA-384 checksum of the file.
sha512 (models.CharField): The expected SHA-512 checksum of the file.
failed_at_backport49 (models.DateTimeField):
The datetime of last download attempt failure. Only for old branches to
avoid migration backport issues.
Relations:
Expand All @@ -729,7 +725,6 @@ class RemoteArtifact(BaseModel, QueryMixin):
content_artifact = models.ForeignKey(ContentArtifact, on_delete=models.CASCADE)
remote = models.ForeignKey("Remote", on_delete=models.CASCADE)
pulp_domain = models.ForeignKey("Domain", default=get_domain_pk, on_delete=models.PROTECT)
failed_at_backport49 = models.DateTimeField(null=True)

objects = BulkCreateManager.from_queryset(RemoteArtifactQuerySet)()

Expand Down
4 changes: 2 additions & 2 deletions pulpcore/content/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ async def _stream_content_artifact(self, request, response, content_artifact):
remote_artifacts = (
content_artifact.remoteartifact_set.select_related("remote")
.order_by_acs()
.exclude(failed_at_backport49__gte=timezone.now() - timedelta(seconds=protection_time))
.exclude(failed_at__gte=timezone.now() - timedelta(seconds=protection_time))
)
async for remote_artifact in remote_artifacts:
try:
Expand Down Expand Up @@ -1126,7 +1126,7 @@ async def finalize():
try:
download_result = await downloader.run()
except DigestValidationError:
remote_artifact.failed_at_backport49 = timezone.now()
remote_artifact.failed_at = timezone.now()
await remote_artifact.asave()
await downloader.session.close()
close_tcp_connection(request.transport._sock)
Expand Down

0 comments on commit ad00328

Please sign in to comment.