[WRONG BRANCH] fix(images): restore connect deadline for provider-returned artifact downloads - #241
[WRONG BRANCH] fix(images): restore connect deadline for provider-returned artifact downloads#241luvs01 wants to merge 1 commit into
Conversation
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesPinned download connection timeout
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8525b9565
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const idleTimeoutMs = options?.idleTimeoutMs ?? DOWNLOAD_IDLE_TIMEOUT_MS; | ||
| return pinnedHttpGet(url, pinned, signal, { | ||
| maxBytes, | ||
| connectTimeoutMs, |
There was a problem hiding this comment.
Arm the deadline for Bun TLS handshakes
When a peer accepts TCP but never completes TLS, forwarding this value does not restore the deadline on the supported Bun 1.3.14 runtime: Bun emits the ClientRequest socket with socket.connecting === false, so pinnedHttpRequest skips creating its connect timer and the artifact download waits for the 60-second idle timeout instead. I reproduced this with a local TCP listener that accepts without speaking TLS; update the shared transport to keep HTTPS connections timed until secureConnect without gating on socket.connecting, and cover that actual socket state rather than forcing connecting: true in the mock.
AGENTS.md reference: src/AGENTS.md:L7-L9
Useful? React with 👍 / 👎.
Motivation
connectTimeoutMsopt-in in the pinned HTTP transport, leaving provider-returned image and video downloads without a TCP/TLS connect deadline and creating an availability regression.Description
DOWNLOAD_CONNECT_TIMEOUT_MS = 10_000default for artifact downloads and exposeconnectTimeoutMsin thepinnedHttpsGetoptions so callers can override it.connectTimeoutMsfrompinnedHttpsGetintopinnedHttpGetso provider-returned image/video fetches install a 10s connection-establishment deadline by default.Testing
bun test tests/images/pinned-https-get.test.tsand the new/updated tests passed.bun run typecheck(tsc --noEmit) and it succeeded.bun run testand test execution completed without failures.bun run privacy:scanand the privacy scan passed.Codex Task
Summary by CodeRabbit
Bug Fixes
Enhancements
Tests