Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabled TCP Keep-Alive to Requests #1065

Merged
merged 1 commit into from
Feb 20, 2021
Merged

Enabled TCP Keep-Alive to Requests #1065

merged 1 commit into from
Feb 20, 2021

Conversation

CastagnaIT
Copy link
Owner

@CastagnaIT CastagnaIT commented Feb 7, 2021

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
Copy link

jakermx commented Feb 12, 2021

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

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