Project

Profile

Help

Issue #1538

closed

Nectar's `download_one` should use the same `Session` object for all requests

Added by jcline@redhat.com over 8 years ago. Updated about 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - Nectar:
Platform Release:
Target Release - Nectar:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Nectar currently creates a new `requests.Session`[0] object for every call to `download_one` in the threaded downloader. This fails to take advantage of the Sessions ability to pool TCP connections. Instead, it should probably have a session that is instantiated with the downloader dedicated to the `download_one` method. My guess is that the Session object is not thread-safe, so we cannot use a single session across the downloader. This may be incorrect, though.

[0] http://docs.python-requests.org/en/latest/user/advanced/#session-objects

Also available in: Atom PDF