While syncing centos 7 os repo below error message is shown if download policy is “Immediate”. Sync is success if the policy is “On Demand”. There is a squid proxy between katello and internet (centos mirror)
Katello::Errors::Pulp3Error: [Errno 104] Connection reset by peer
smartproxy = 2.1.3
katello = 188.8.131.52
foreman-tasks = 2.0.2
Detailed error message here - https://gist.github.com/rokbasnr/207035b15db27fefdd365859ee90ece9
This symptom sounds like it might be related to this Pulp issue
See more info here
The fix will be in 3.17 (pulp 3.6) but if this is your issue, you may be able to adjust the concurrency on your existing repos by hand to workaround this problem.
Set default value for download_concurrency to 1 in below files and restarted services through foremain-maintain command, but again hit the same error.