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

httpx TimeoutError #8

Closed
simonw opened this issue Feb 16, 2022 · 5 comments
Closed

httpx TimeoutError #8

simonw opened this issue Feb 16, 2022 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Feb 16, 2022

Got this exception while testing code from #7:

  File "/Users/simon/Dropbox/Development/google-drive-to-sqlite/google_drive_to_sqlite/utils.py", line 25, in paginate_files
    data = httpx.get(
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_api.py", line 189, in get
    return request(
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_api.py", line 100, in request
    return client.request(
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_client.py", line 802, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_client.py", line 889, in send
    response = self._send_handling_auth(
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_client.py", line 917, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_client.py", line 954, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_client.py", line 990, in _send_single_request
    response = transport.handle_request(request)
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_transports/default.py", line 217, in handle_request
    with map_httpcore_exceptions():
  File "/Users/simon/.pyenv/versions/3.10.0/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/Users/simon/.local/share/virtualenvs/google-drive-to-sqlite-Wr1nXkpK/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout: The read operation timed out
@simonw simonw added the bug Something isn't working label Feb 16, 2022
@simonw
Copy link
Owner Author

simonw commented Feb 16, 2022

https://www.python-httpx.org/advanced/#timeout-configuration says default is 5s - I'm going to bump that up to 10s.

@simonw
Copy link
Owner Author

simonw commented Feb 16, 2022

Bumping it up to 10s is good enough for the moment.

@simonw simonw changed the title Handle httpx TimeoutError httpx TimeoutError Feb 16, 2022
@simonw simonw closed this as completed in 7f06224 Feb 16, 2022
@simonw
Copy link
Owner Author

simonw commented Feb 16, 2022

Hit this again, during a really long --folder operation.

It's frustrating because it means I have to start the thing running again - it loses its context.

@simonw simonw reopened this Feb 16, 2022
@simonw
Copy link
Owner Author

simonw commented Feb 16, 2022

I think I want an exponential backoff retry here.

@simonw
Copy link
Owner Author

simonw commented Feb 17, 2022

Or... bump it up to 30s, which seems to work fine.

@simonw simonw closed this as completed in 057128c Feb 17, 2022
@simonw simonw added this to the 0.1a1 milestone Feb 17, 2022
simonw added a commit that referenced this issue Feb 17, 2022
simonw added a commit that referenced this issue Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant