Skip to content

Inflight Concurrency Cap Bypass on Streaming Bodies #1666

Closed

Description

@ujjwalredd

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.

Activity

  1. mishushakov commented on Aug 19, 2026

    @mishushakov
    Member

    /sdk draft

  2. devin-ai-integration commented on Aug 19, 2026

    @devin-ai-integration
    Contributor

    Triage

    • type: bug
    • priority: medium
    • complexity: small
    • affected_area: js-sdk / api inflight concurrency limiter
    • actionable: yes
    • needs_clarification: false
    • summary: limitConcurrency releases its semaphore on response headers rather than body completion, letting streaming requests bypass the inflight cap and exhaust HTTP/2 streams (matches the TODO in js-sdk/src/api/inflight.ts).

    Written by Devin

  3. devin-ai-integration commented on Oct 13, 2026

    @devin-ai-integration
    Contributor

    @ujjwalredd thanks for reporting this. It's fixed in e2b@2.56.0 (JS SDK) by #1733, which supersedes #1717. That PR removes the SDK-level in-flight cap (limitConcurrency in inflight.ts) entirely, so there's no slot accounting left to bypass. The SDK now depends only on undici@^8, which respects the server's HTTP/2 SETTINGS_MAX_CONCURRENT_STREAMS and opens more connections instead of hitting ERR_HTTP2_TOO_MANY_CONCURRENT_STREAMS.

    Heads-up, this is a breaking change: the E2B_*_INFLIGHT_REQUESTS env vars are gone, and the SDK now requires Node.js >= 22.19.0.

    Upgrade: npm i e2b@2.56.0

    Written by Devin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsdkImprovements or additions to SDKs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions