You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error occurs intermittently, approximately once every 5,000 requests. It appears to be a well-known httpx issue.
We increased the timeout from 15 to 30 seconds but are still encountering the error. From our observations, it seems the timeout setting in BentoML is not being propagated to the httpx client. A user increased the timeout on the service and client, which appeared to resolve the issue.
See stacktrace below:
httpx.RemoteProtocolError: Server disconnected without sending a response.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 72, in map_httpcore_exceptions
yield
File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 377, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 216, in handle_async_request
raise exc from None
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 196, in handle_async_request
response = await connection.handle_async_request(
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
return await self._connection.handle_async_request(request)
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 143, in handle_async_request
raise exc
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 113, in handle_async_request
) = await self._receive_response_headers(**kwargs)
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 186, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
File "/usr/local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 238, in _receive_event
raise RemoteProtocolError(msg)
httpcore.RemoteProtocolError: Server disconnected without sending a response.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/ddtrace/contrib/httpx/patch.py", line 142, in _wrapped_async_send
resp = await wrapped(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1674, in send
response = await self._send_handling_auth(
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1702, in _send_handling_auth
response = await self._send_handling_redirects(
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1739, in _send_handling_redirects
response = await self._send_single_request(request)
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1776, in _send_single_request
response = await transport.handle_async_request(request)
File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 377, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "/usr/local/lib/python3.9/site-packages/httpx/_transports/default.py", line 89, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.RemoteProtocolError: Server disconnected without sending a response.
shihgianlee
changed the title
bug: Intermittent httpcore.RemoteProtocolError: Server disconnected without sending a response.
bug: Intermittent httpx.RemoteProtocolError: Server disconnected without sending a response.
Sep 11, 2024
Hi @shihgianlee, thanks for reporting the issue. Could you share more about your service code structure and where the timeout value was set?
Sure. We have 2 services defined where service A depends on service B. We have adaptive batching turned on in service B. Also, we have async defined in service A. However, we are getting intermittent Server disconnected without sending a response errors when calling service B from service A in our production Kubernetes cluster.
Describe the bug
The error occurs intermittently, approximately once every 5,000 requests. It appears to be a well-known httpx issue.
We increased the timeout from 15 to 30 seconds but are still encountering the error. From our observations, it seems the timeout setting in BentoML is not being propagated to the httpx client. A user increased the timeout on the service and client, which appeared to resolve the issue.
See stacktrace below:
To reproduce
See httpx error reproduction.
Expected behavior
No response
Environment
Environment variable
System information
bentoml
: 1.3.2python
: 3.9.20platform
: Linux-6.1.85+-x86_64-with-glibc2.36uid_gid
: 1034:1034pip_packages
The text was updated successfully, but these errors were encountered: