From ad0032865ca5422799f8bb65c69ae955a30f2d4f Mon Sep 17 00:00:00 2001 From: Pedro Brochado Date: Tue, 14 Jan 2025 13:50:32 -0300 Subject: [PATCH] Revert "Backport workaround for adding RA cooldown" This reverts commit 5fa90196f57be652d8d9167fb39061a92f1b3f75. --- ...0118_remoteartifact_failed_at_backport49.py | 18 ------------------ pulpcore/app/models/content.py | 5 ----- pulpcore/content/handler.py | 4 ++-- 3 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 pulpcore/app/migrations/0118_remoteartifact_failed_at_backport49.py diff --git a/pulpcore/app/migrations/0118_remoteartifact_failed_at_backport49.py b/pulpcore/app/migrations/0118_remoteartifact_failed_at_backport49.py deleted file mode 100644 index e28e43be6a..0000000000 --- a/pulpcore/app/migrations/0118_remoteartifact_failed_at_backport49.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 4.2.17 on 2025-01-10 20:56 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('core', '0117_task_unblocked_at'), - ] - - operations = [ - migrations.AddField( - model_name='remoteartifact', - name='failed_at_backport49', - field=models.DateTimeField(null=True), - ), - ] diff --git a/pulpcore/app/models/content.py b/pulpcore/app/models/content.py index e3adc44388..b41390425b 100644 --- a/pulpcore/app/models/content.py +++ b/pulpcore/app/models/content.py @@ -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: @@ -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)() diff --git a/pulpcore/content/handler.py b/pulpcore/content/handler.py index 28078b9a33..390122da50 100644 --- a/pulpcore/content/handler.py +++ b/pulpcore/content/handler.py @@ -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: @@ -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)