Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

api: ReadTimeout: 10s kills body reads under high concurrency, conflicting with requestTimeout: 70s

Open Beginner friendly
#3,415 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
go
Domain
api, backend

Research direction

Start in packages/api/main.go and inspect the http.Server timeout configuration, especially ReadTimeout, ReadHeaderTimeout, and the requestTimeout middleware described in the issue. Done means removing ReadTimeout while retaining ReadHeaderTimeout and the 70-second request deadline, then verifying the API builds and its existing tests pass.

Written by the indexing model from the issue text.

Description

Problem

Under high concurrency (e.g. 1 000 simultaneous sandbox creates) the API returns a flood of errors with:

reading failed: read tcp 192.168.0.146:3000->...: i/o timeout

Root cause

packages/api/main.go configures two competing timeouts:

Setting Value Scope
ReadTimeout 10 s Starts at TCP accept; covers headers + body
requestTimeout 70 s Context deadline applied by middleware

Go's http.Server.ReadTimeout starts counting from the moment the TCP connection is accepted — including scheduler queue time. Under high concurrency, goroutines may wait >10 s in the scheduler before they ever execute and call io.ReadAll. By then the ReadTimeout has already fired and the connection is dead.

requestTimeout: 70 s is the intended per-request ceiling but is never reached in practice because ReadTimeout: 10s fires first.

Why ReadHeaderTimeout is sufficient

ReadHeaderTimeout: 5s already guards against slowloris (headers never arrive). Once headers are received and ServeHTTP starts, request bodies on this API are small JSON payloads (<1 KB) sent in a single TCP segment — there is no meaningful slow-body attack surface. The requestTimeout: 70s middleware context provides the actual per-request deadline for handler execution.

Fix

Remove ReadTimeout from the http.Server config. Keep ReadHeaderTimeout for slowloris protection.

Dominant language
Go
Stars
1.6k
Forks
448
PR merge metrics
No merged PRs in 30d

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from e2b-dev/runtime

All issues in e2b-dev/runtime

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.