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
Browse filesBrowse the repository at this point in the historyBrowse files
Alex Wang
committed
fix(insight): make HttpExporter timeout_ms a request deadline
- http_send: build the opener per request with handlers that create
deadline-aware connections; a timer shuts the live socket down when
the deadline expires and TimeoutError is raised, so a peer trickling
bytes can no longer keep a request alive past timeout_ms
- every TCP attempt is budgeted with the remaining time and registered
with the deadline, so a stalled connect is aborted on time; expiry is
judged by the monotonic clock after the request and after the error
body read, so a late response is never reported as success
- the urllib transport is otherwise unchanged (redirects refused,
header merging, IPv6 hosts, proxy settings, default TLS context)
- tests: trickled status line, trickled error body, slow name
resolution, stalled connect, header case merge, unsupported scheme
Copy file name to clipboardExpand all lines: packages/aws-durable-execution-sdk-python-insight/src/aws_durable_execution_sdk_python_insight/exporters/_common.py
Copy file name to clipboardExpand all lines: packages/aws-durable-execution-sdk-python-insight/src/aws_durable_execution_sdk_python_insight/exporters/http_exporter.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -33,8 +33,11 @@ class HttpMethod(StrEnum):
33
33
classHttpExporter:
34
34
"""Sends each record as a JSON body to any HTTP endpoint.
35
35
36
-
The endpoint must answer 2xx; any other status raises. ``timeout_ms``
37
-
bounds the whole request (default 10 seconds). ``max_record_size_bytes``
36
+
The endpoint must answer 2xx; any other status raises. ``timeout_ms`` is a
37
+
deadline for the whole request (connect, send, response headers and any
38
+
error body; default 10 seconds); on expiry the connection is shut down and
39
+
``TimeoutError`` is raised. Name resolution is not interruptible.
40
+
``max_record_size_bytes``
38
41
has no default because a generic endpoint has no known limit.
0 commit comments