[PR #6026/5801bf97 backport][3.63] [SAT-22998] Ensure Pulp closes the connection on corrupted streamed content #6081
+76
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Assuming we want to keep our stream-redirect approach on the content-app, We cant recover from wrong data already sent if the Remote happens to be corrupted (contains wrong binaries).
In order to not give a 200 reponse to client, we decided to close the connection as soon as the request handler realizes the checksum is wrong.
That only happens after we already sent the whole blob minus EOF, so we close the connection before sending the EOF.
Additionally, we put some message on the logs for admins to see and have a chance to manually fix the remote/remote_artifacts.
Co-authored-by: Matthias Dellweg [email protected]
fixes #5012
(cherry picked from commit 5801bf9)