Skip to content

docs(insight): state HttpExporter timeout_ms scope - #732

Merged
wangyb-A merged 1 commit into
mainfrom
docs/insight-http-timeout-semantics
Sep 16, 2026
Merged

wangyb-A merged 1 commit into
mainfrom
docs/insight-http-timeout-semantics

Conversation

@wangyb-A

Copy link
Copy Markdown
Contributor

Summary

Corrects the HttpExporter documentation of timeout_ms. The docstring said the value "bounds the whole request". It does not: http_send passes it to urllib, which applies it to each blocking socket operation (the connect and every read). An endpoint that goes silent fails at timeout_ms; one that keeps sending bytes slowly can hold the request open for longer. Review of #720 measured 37 s with timeout_ms=2000 against a server sending one byte per second.

This PR documents the behaviour rather than changing it. The wording reserves the right to enforce timeout_ms as a whole-request deadline in a future release and tells callers not to rely on a request being allowed to exceed it, so a later fix can ship as a bug fix against a documented reservation rather than as a behaviour change.

Changes:

  • HttpExporter class docstring: describes the per-operation semantics, the silent-vs-slow distinction, the future-deadline reservation, and the advice to size the function timeout accordingly.
  • http_send docstring: states that timeout is urllib's per-socket-operation timeout.
  • README ### HttpExporter: the same one-sentence caveat and reservation.
  • test_timeout_is_enforced renamed to test_timeout_applies_to_a_silent_peer, which is what the test exercises (a server that delays before sending anything). No assertion changed.

No code path changes. OTelExporter and OpenSearchExporter are not affected; they pass no timeout.

Testing

  • hatch fmt --check in packages/aws-durable-execution-sdk-python-insight: ruff check and format clean.
  • hatch run test:all packages/aws-durable-execution-sdk-python-insight/tests/test_http_exporter.py: 13 passed.

Follows up on the review comment in #720 (#720 (comment)).

@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 16, 2026 17:13 — with GitHub Actions Active
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 16, 2026 17:13 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the docs/insight-http-timeout-semantics branch from 44c8812 to 6c6f2d7 Compare September 16, 2026 17:33
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 16, 2026 17:33 — with GitHub Actions Active
@github-actions

This comment has been minimized.

The HttpExporter docstring said timeout_ms "bounds the whole request".
It does not: http_send passes it to urllib, which applies it to each
blocking socket operation. An endpoint that stops reading or goes
silent fails at timeout_ms, but one that keeps consuming or sending
bytes slowly can hold the request open for longer (measured in review
of #720: 37 s with timeout_ms=2000 against a 1 byte/s server).

- HttpExporter docstring: name the phases the timeout applies to (the
  connect, each write of the request, each read of the status line,
  headers, and a non-2xx error body; a 2xx body is never read), note
  that a future release may enforce timeout_ms as a whole-request
  deadline, and tell callers to size the function timeout with this
  in mind
- http_send docstring: same per-operation description
- README HttpExporter section: same caveat and reservation
- rename test_timeout_is_enforced to test_timeout_applies_to_a_silent_peer,
  which is the case it exercises; no assertion changed

No behaviour change.
@wangyb-A
wangyb-A force-pushed the docs/insight-http-timeout-semantics branch from 6c6f2d7 to b843146 Compare September 16, 2026 18:17
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 16, 2026 18:17 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

No actionable findings. Residual test risk: the renamed test covers only a peer silent before responding; slow-drip responses and blocked writes remain untested.

Reviewed commit b843146344f9d10d4d5718648b62dafb88037d72. Workflow run

@wangyb-A
wangyb-A merged commit cf4d27f into main Sep 16, 2026
37 checks passed
@wangyb-A
wangyb-A deleted the docs/insight-http-timeout-semantics branch September 16, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants