-
-
Notifications
You must be signed in to change notification settings - Fork 961
Description
I am experiencing a problem where my container crashes or resets immediately after an HTTP POST request logs this debug message:
2025-08-06 10:07:03,466 - httpcore.connection - DEBUG - close.started
2025-08-06 10:07:03,467 - httpcore.connection - DEBUG - close.complete
2025-08-06 10:07:03,468 - httpcore.connection - DEBUG - connect_tcp.started host='us-central1-aiplatform.googleapis.com' port=443 local_address=None timeout=60.0 socket_options=None
2025-08-06 10:07:03,653 - httpcore.connection - DEBUG - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x7bd514187b10>
2025-08-06 10:07:03,654 - httpcore.connection - DEBUG - start_tls.started ssl_context=<ssl.SSLContext object at 0x7bd514731be0> server_hostname='us-central1-aiplatform.googleapis.com' timeout=60.0
2025-08-06 10:07:03,840 - httpcore.connection - DEBUG - start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x7bd62bd80250>
2025-08-06 10:07:03,840 - httpcore.http11 - DEBUG - send_request_headers.started request=<Request [b'POST']>
2025-08-06 10:07:03,841 - httpcore.http11 - DEBUG - send_request_headers.complete
2025-08-06 10:07:03,841 - httpcore.http11 - DEBUG - send_request_body.started request=<Request [b'POST']>
2025-08-06 10:07:04,201 - httpcore.http11 - DEBUG - send_request_body.complete
2025-08-06 10:07:04,202 - httpcore.http11 - DEBUG - receive_response_headers.started request=<Request [b'POST']>
The full request lifecycle up to sending the request body completes successfully, but right after the client starts receiving the response headers, the container unexpectedly resets.
Details:
The HTTP client is built using httpcore (possibly through httpx).
The logs show normal request steps without errors, but the container crashes during or shortly after receiving response headers.
This happens consistently and causes service interruption.
Containerised app running on Docker
HTTP client using httpcore
OS, Docker version, and relevant runtime stream LLM async streaming
I have implemented timeouts and configured a safe connection pool with a high number of connections to handle load smoothly.
Request for help:
I see it like my issue encode/httpcore#990
Has anyone encountered a similar issue where httpcore logs receive_response_headers.started and the container crashes?
Are there known bugs or configurations that cause unstable behavior at this step?
Suggestions on debugging or workaround to prevent container crash/reset are appreciated.