Skip to content

Enabled TCP Keep-Alive to Requests#1065

Merged
CastagnaIT merged 1 commit into
masterfrom
keepalive
Feb 20, 2021
Merged

Enabled TCP Keep-Alive to Requests#1065
CastagnaIT merged 1 commit into
masterfrom
keepalive

Conversation

@CastagnaIT

@CastagnaIT CastagnaIT commented Feb 7, 2021

Copy link
Copy Markdown
Owner

Check if this PR fulfills these requirements:

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Feature change (non-breaking change which change behaviour of an existing functionality)
  • Improvement (non-breaking change which improve functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

From research conducted by @jakermx discovered that Requests module provide Keep-Alive support thanks to urllib3 module,
but the real problem is that the Keep-Alive in the urllib3 module is not enabled by default https://urllib3.readthedocs.io/en/latest/reference/urllib3.connection.html and this is not mentioned in Requests module documentations.

By tracking network activities with Wireshark there is a clear evidence of the lack of TCP keep-alive communications,
and enable it seem definitively resolve the errors:
ConnectionError: ('Connection aborted.', error("(104, 'ECONNRESET')",))
ReadTimeout: HTTPSConnectionPool(host='www.n*****x.com', port=443): Read timed out. (read timeout=None)
Ref issues: #1004, #914

then this (partially) nullifies the workaround of PR #1046 (read below)

unfortunately the embedded python on Kodi 19 for Windows has been compiled without socket.ioctl therefore is unusable,
i have opened an issue xbmc/xbmc#19204 to ask to fix it and (i hope) will be included on Kodi 19.1

The fix has been merged on Kodi nightly

In case of Feature change / Breaking change:

Describe the current behavior

Describe the new behavior

Screenshots (if appropriate):

@CastagnaIT CastagnaIT force-pushed the keepalive branch 6 times, most recently from 3934a9a to dcd1e87 Compare February 12, 2021 09:04
@jakermx

jakermx commented Feb 12, 2021

Copy link
Copy Markdown

nevermind....it is for koi19 based on python3

@CastagnaIT CastagnaIT merged commit 664211c into master Feb 20, 2021
@CastagnaIT CastagnaIT deleted the keepalive branch February 20, 2021 08:35
@CastagnaIT CastagnaIT mentioned this pull request Feb 25, 2021
9 tasks
@CastagnaIT CastagnaIT mentioned this pull request Sep 17, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants