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

Fix timeouts #25

Closed
andy-maier opened this issue Jan 7, 2020 · 2 comments
Closed

Fix timeouts #25

andy-maier opened this issue Jan 7, 2020 · 2 comments
Assignees
Milestone

Comments

@andy-maier
Copy link
Owner

Actual behavior

Even though the timeout is supposedly increased to 300 sec, both connections and operations time out at the requests level.

Example for connection timeout (can be triggered with direct connection in an environment that does not have a network connection to the PMS server):

Using plexmediafixup config file: try/ds12_config_file.yml
Using PlexAPI config file: /Users/maiera/.config/plexapi/config.ini
Loading fixup: sync_title
Loading fixup: sync_sort_title
Traceback (most recent call last):
  File "/Users/maiera/virtualenvs/plex27/bin/plexmediafixup", line 11, in <module>
    load_entry_point('plexmediafixup', 'console_scripts', 'plexmediafixup')()
  File "/Users/maiera/PycharmProjects/plex/repos/plexmediafixup/plexmediafixup/cli.py", line 281, in main
    plex = plexapi.server.PlexServer()
  File "/Users/maiera/virtualenvs/plex27/lib/python2.7/site-packages/plexapi/server.py", line 103, in __init__
    data = self.query(self.key, timeout=timeout)
  File "/Users/maiera/virtualenvs/plex27/lib/python2.7/site-packages/plexapi/server.py", line 376, in query
    response = method(url, headers=headers, timeout=timeout, **kwargs)
  File "/Users/maiera/virtualenvs/plex27/lib/python2.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', url, **kwargs)
  File "/Users/maiera/virtualenvs/plex27/lib/python2.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/maiera/virtualenvs/plex27/lib/python2.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/Users/maiera/virtualenvs/plex27/lib/python2.7/site-packages/requests/adapters.py", line 504, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='192.168.0.12', port=32400): Max retries exceeded with url: / (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x1101bb190>, 'Connection to 192.168.0.12 timed out. (connect timeout=30)'))

Expected behavior

timeout of 300 sec is honored for operations, but 30 sec stays for connections.

Execution environment

  • PlexMediaFixup version:
  • Python version:
  • Operating System (type+version):
@andy-maier andy-maier self-assigned this Jan 7, 2020
@andy-maier andy-maier added this to the 0.3.0 milestone Jan 7, 2020
@andy-maier
Copy link
Owner Author

I recently saw cases where requests times out also with a read timeout of 30sec.

@andy-maier
Copy link
Owner Author

Fixed in PR #39.

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

No branches or pull requests

1 participant