Synchronous connection pools without timeout fail in 1.0.1 #845
Answered
by
karpetrosyan
ToBeReplaced
asked this question in
Potential Issue
-
>>> import httpcore, itertools; from concurrent.futures import ThreadPoolExecutor
>>> print(httpcore.__version__)
1.0.1
>>> pool = httpcore.ConnectionPool(max_connections=1)
>>> gets = itertools.repeat("GET", 3)
>>> urls = itertools.repeat("https://github.com/encode/httpcore", 3)
>>> list(ThreadPoolExecutor().map(pool.request, gets, urls))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
yield _result_or_cancel(fs.pop())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
return fut.result(timeout)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_sync/interfaces.py", line 43, in request
response = self.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 248, in handle_request
raise exc
File "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 239, in handle_request
connection = status.wait_for_connection(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 36, in wait_for_connection
self._connection_acquired.wait(timeout=timeout)
File "/usr/local/lib/python3.11/site-packages/httpcore/_synchronization.py", line 229, in wait
if not self._event.wait(timeout=timeout):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/threading.py", line 629, in wait
signaled = self._cond.wait(timeout)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/threading.py", line 331, in wait
gotit = waiter.acquire(True, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: timestamp out of range for platform time_t I believe the issue is caused by #823 , specifically f8ff1c4#diff-5713be2b281222b211bec1272100cb70677f728181a11c4ff06e6a10ae3c30d2R230 |
Beta Was this translation helpful? Give feedback.
Answered by
karpetrosyan
Nov 8, 2023
Replies: 1 comment 2 replies
-
Whoops! Forgot to add... Thank you for maintaining this project. It is my tool of choice for reliable HTTP where having confidence in what is happening is paramount. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resolved in #846