Bug 1458765

Summary: Incorrect retry count evaluation and better exception handle
Product: Red Hat Satellite 5 Reporter: Jan Dobes <jdobes>
Component: ServerAssignee: Jan Dobes <jdobes>
Status: CLOSED ERRATA QA Contact: Radovan Drazny <rdrazny>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: ggainey, lhellebr, rdrazny, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-2.5.3-149-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-06 12:27:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1450111    

Description Jan Dobes 2017-06-05 12:19:50 UTC
Description of problem:
There are 2 commits in spacewalk master for reposync/cdnsync downloader:

1. 72a30c87aeda3833ca6c0f5607961582dbbfe5b5
- fixing maximal retry count if there is more mirrors than default retries - 3

2. 6bb8389788991a29fe3c112ec84a6c3ca6046c45
- catching KeyboardException preventing some ugly traceback during downloading

These commits have incorrectly BZ1446198 in their message but they are not mentioned in BZ1446198.

Comment 1 Jan Dobes 2017-07-25 09:54:36 UTC
Switching to MODIFIED because these commits are already in spacewalk.

Comment 6 Radovan Drazny 2017-08-18 12:39:03 UTC
Tested on spacewalk-backend-2.5.3-149. As there is no real bug or reproducer present, I did just a bit of manual testing based on info from Jan. First commit just fixes an obvious mistake in the code, the other one improves interrupt handling in the package downloading phase of cdn-sync. When Ctrl+C'ed, cdn-sync now finishes all remaining transfers before exiting. In case of network connectivity loss (simulated with "iptables -A OUTPUT -p tcp --destination-port 443 -j DROP") it is still possible to interrupt the process, but it takes two Ctrl+C's. 

VERIFIED

Comment 7 Lukáš Hellebrandt 2017-08-29 12:02:01 UTC
Re-verified with spacewalk-backend-2.5.3-151.

Tested on cdn-sync and spacewalk-repo-sync:
1) Sanity - the tools work as expected, checked by automation
2) CTRL+C now doesn't produce ugly traceback and waits for open connections to close - valid for "download" phases, but for example after "<time> Repo URL: <URL>" output, CTRL+C results in

"""
^CTraceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/urlgrabber/grabber.py", line 1603, in _progress_update
    def _progress_update(self, download_total, downloaded, upload_total, uploaded):
KeyboardInterrupt

Process has been interrupted.
"""

... which is not subject of this BZ.

Comment 8 errata-xmlrpc 2017-09-06 12:27:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:2645