e2b-dev / e2b-dev/E2B

Inflight Concurrency Cap Bypass on Streaming Bodies

Open
#1,666 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug sdk
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.