Inflight Concurrency Cap Bypass on Streaming Bodies
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 13.9k
- Forks
- 1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 70
Description
Currently in the JS SDK, the limitConcurrency wrapper around fetch releases the semaphore early (on headers) instead of when the response body is fully consumed. This defeats the connection accounting for streaming requests (e.g., logs, command execution) and can exhaust HTTP/2 streams (ERR_HTTP2_TOO_MANY_CONCURRENT_STREAMS). There is a clear TODO for this in js-sdk/src/api/inflight.ts.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in js-sdk/src/api/inflight.ts at the limitConcurrency wrapper and its TODO, then trace how fetch responses and streaming bodies are consumed. Ensure the semaphore remains held until the response body is fully consumed rather than only until headers arrive, and verify the JS SDK tests cover concurrent streaming requests without exceeding the connection limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100