Occasional BrokenPipeError: [Errno 32] Broken pipe
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
I occasionally get the following exception in the lambda runtime. It seems to just happen randomly every couple weeks. This may just be a general lambda python runtime issue. Note that duration of the lambda is 5.7 seconds whereas my chalice configuration has lambda_timeout set to 30 seconds.
START RequestId: e6d68f3a-5857-46ab-893f-e3c3c70ea085 Version: $LATEST
--
Traceback (most recent call last):
File "/var/runtime/bootstrap", line 9, in
main()
File "/var/runtime/bootstrap.py", line 360, in main
event_request.deadline_time_in_ms)
File "/var/runtime/bootstrap.py", line 138, in handle_event_request
lambda_runtime_client.post_invocation_result(invoke_id, result, result_content_type)
File "/var/runtime/lambda_runtime_client.py", line 79, in post_invocation_result
self.runtime_connection.request("POST", endpoint, result_data, headers={'Content-Type': content_type})
File "/var/lang/lib/python3.7/http/client.py", line 1281, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/var/lang/lib/python3.7/http/client.py", line 1327, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/var/lang/lib/python3.7/http/client.py", line 1276, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/var/lang/lib/python3.7/http/client.py", line 1075, in _send_output
self.send(chunk)
File "/var/lang/lib/python3.7/http/client.py", line 997, in send
self.sock.sendall(data)
BrokenPipeError: [Errno 32] Broken pipe
END RequestId: e6d68f3a-5857-46ab-893f-e3c3c70ea085
REPORT RequestId: e6d68f3a-5857-46ab-893f-e3c3c70ea085 Duration: 5706.56 ms Billed Duration: 5707 ms Memory Size: 2048 MB Max Memory Used: 448 MB
RequestId: e6d68f3a-5857-46ab-893f-e3c3c70ea085 Error: Runtime exited with error: exit status 1Runtime.ExitError
Contributor guide
Research direction
Start with the reported traceback in /var/runtime/bootstrap.py and /var/lang/lib/python3.7/http/client.py, then compare it with the Chalice lambda_timeout setting and AWS Lambda runtime behavior. Done means identifying whether Chalice contributes to the intermittent BrokenPipeError and documenting a reproducible cause or appropriate resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100