Skip to content

Commit

Permalink
fixup: rename the cooldown setting
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-psb committed Dec 5, 2024
1 parent 4b4b195 commit 215397e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pulpcore/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
# The time a RemoteArtifact will be ignored after failure.
# In on-demand, if a fetching content from a remote failed due to corrupt data,
# the corresponding RemoteArtifact will be ignored for that time (seconds).
FAILED_REMOTE_ARTIFACT_COOLDOWN_TIME = 5 * 60 # 5 minutes
REMOTE_CONTENT_FETCH_FAILURE_COOLDOWN = 5 * 60 # 5 minutes

SPECTACULAR_SETTINGS = {
"SERVE_URLCONF": ROOT_URLCONF,
Expand Down
6 changes: 3 additions & 3 deletions pulpcore/content/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ async def _stream_content_artifact(self, request, response, content_artifact):
ClientConnectionError,
)

protection_time = settings.FAILED_REMOTE_ARTIFACT_COOLDOWN_TIME
protection_time = settings.REMOTE_CONTENT_FETCH_FAILURE_COOLDOWN
remote_artifacts = (
content_artifact.remoteartifact_set.select_related("remote")
.order_by_acs()
Expand Down Expand Up @@ -1151,14 +1151,14 @@ async def finalize():
await remote_artifact.asave()
await downloader.session.close()
close_tcp_connection(request.transport._sock)
FAILED_REMOTE_ARTIFACT_COOLDOWN_TIME = settings.FAILED_REMOTE_ARTIFACT_COOLDOWN_TIME
REMOTE_CONTENT_FETCH_FAILURE_COOLDOWN = settings.REMOTE_CONTENT_FETCH_FAILURE_COOLDOWN
raise RuntimeError(
f"Pulp tried streaming {remote_artifact.url!r} to "
"the client, but it failed checksum validation.\n\n"
"We can't recover from wrong data already sent so we are:\n"
"- Forcing the connection to close.\n"
"- Marking this Remote to be ignored for "
f"{FAILED_REMOTE_ARTIFACT_COOLDOWN_TIME=}s.\n\n"
f"{REMOTE_CONTENT_FETCH_FAILURE_COOLDOWN=}s.\n\n"
"If the Remote is known to be fixed, try resyncing the associated repository.\n"
"If the Remote is known to be permanently corrupted, try removing "
"affected Pulp Remote, adding a good one and resyncing.\n"
Expand Down

0 comments on commit 215397e

Please sign in to comment.