Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1446198

Summary: Downloading from repository should use keep-alive for HTTPS connections
Product: Red Hat Satellite 5 Reporter: Jan Dobes <jdobes>
Component: Satellite SynchronizationAssignee: Jan Dobes <jdobes>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Korbel <mkorbel>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: jhutar, mkorbel, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-backend-2.5.3-117 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:14:16 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: 1340444    

Description Jan Dobes 2017-04-27 12:27:41 UTC
Description of problem:
E.g. cdn-sync and spacewalk-repo-sync package download will create new connection for every single package. The reason is urlgrabber library enforcing this in pycurl in case HTTPS and client certificate is specified - some old workaround in library?

Version-Release number of selected component (if applicable):
spacewalk-backend-2.5.3-112

How reproducible:
always

Steps to Reproduce:
1. Sync repository using cdn-sync or spacewalk-repo-sync with client SSL certificate
2. Monitor HTTP communication and notice slower speed

Actual results:
New connections created and handshakes done every time. Slower speed of download.

Expected results:
Keep-alive is set, connection is not closed. Faster speed of download.

Comment 1 Jan Dobes 2017-04-27 13:51:01 UTC
fixed in spacewalk master:

96d5df6c25cf11fe14d0d3b8029d11a721566b3d
0180181ec98abf1edf8b0a2ff1d56a1cb4c49514
103b63e24b46bd58c239f78341b5dcb910ea7d87
6e80906876f3dc46c51a5f1c444d07cd96e3d0c0

Comment 4 Jan Dobes 2017-04-27 15:54:26 UTC
Note: this is causing regression in cdn-sync --count-packages where it runs out of file descriptors most probably because it keeps opened SSL certificate files which are stored per repository on disk - and it's problem when all repositories are pinged in one run. This needs to be fixed.

Comment 5 Jan Dobes 2017-04-28 16:33:20 UTC
Problem from comment #4 fixed in spacewalk master:

b2541b93f54325697a5aea7e9e901dd1737c03c0
3a4b40aebd62334105ada0ddf00025cac851c4c1

Comment 8 Jan Dobes 2017-05-02 13:49:25 UTC
fixing pylint in spacewalk master:

c0589e0a2c4306bb28c265c19f2b439066ae3ade

Comment 11 Martin Korbel 2017-05-26 11:54:34 UTC
VERIFIED on


Reproducer:
0. We have got two satellites, one with new package and one with old version. We execute these steps on the both of them.
1. in the first terminal, we start to synchronize the channel (some big channel is better)
2. in the second terminal we execute this command
> watch -n 1 "ss -e -4 -p | grep cdn-sync | sort"

Old version:
ESTAB      0      200         172.16.20.164:60398      173.222.140.251:https    timer:(on,209ms,0) users:(("cdn-sync",6036,14)) ino:57623 sk:ffff8801385568c0
ESTAB      0      245         172.16.20.164:60394      173.222.140.251:https    timer:(on,224ms,0) users:(("cdn-sync",6036,18)) ino:57618 sk:ffff880062ba97c0
ESTAB      0      320         172.16.20.164:60396      173.222.140.251:https    timer:(on,228ms,0) users:(("cdn-sync",6036,17)) ino:57621 sk:ffff88008f8b77c0
[root@host-8-179-208 old]# ss -e -4 -p | grep cdn-sync | sort
ESTAB      0      0           172.16.20.164:60454      173.222.140.251:https    users:(("cdn-sync",6036,12)) ino:58533 sk:ffff88013cc980c0
SYN-SENT   0      1           172.16.20.164:60462      173.222.140.251:https    timer:(on,998ms,0) users:(("cdn-sync",6036,20)) ino:58545 sk:ffff880139d41780


New version:
ESTAB      0      0           172.16.20.143:49854      173.222.140.251:https    users:(("cdn-sync",24634,12)) ino:788382 sk:ffff88013ab420c0
ESTAB      0      0           172.16.20.143:49856      173.222.140.251:https    users:(("cdn-sync",24634,14)) ino:788383 sk:ffff88013bc090c0
ESTAB      0      0           172.16.20.143:49858      173.222.140.251:https    users:(("cdn-sync",24634,18)) ino:788384 sk:ffff88013b62c880
ESTAB      0      0           172.16.20.143:49860      173.222.140.251:https    users:(("cdn-sync",24634,16)) ino:788385 sk:ffff88013bc841c0
ESTAB      0      0           172.16.20.143:49862      173.222.140.251:https    users:(("cdn-sync",24634,20)) ino:788475 sk:ffff88013c71a0c0


We can see differents between old and new version.
With old version, every second there is different output/rows/local_outgoing_port.
With new version, the rows/local_outgoing_ports are unchanged.
The new version is distinctly faster.