imroc / imroc/req

Upstream Sync Report 2026-09-02: Transport.CancelRequest becomes a no-op

Open
#533 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement modified-stdlib priority:low
Dominant language
Go
Stars
4.9k
Forks
409
Avg merge
6h 47m
Merged PRs (30d)
7

Description

Upstream Change

Go stdlib commit a0f3b6a (2026-08-31):

net/http: make Transport.CancelRequest into a no-op

Fixes golang/go#79040.

Affected Code

req inlines src/net/http/transport.go as root transport.go, which still contains the legacy cancellation machinery:

  • Transport.reqMu / Transport.reqCanceler fields
  • prepareTransportCancel (registers every in-flight request in a per-Transport map)
  • Transport.CancelRequest implementation
  • roundTrip wiring that installs the wrapper cancel func

What the upstream change does

  • Removes reqMu / reqCanceler and prepareTransportCancel
  • Turns the deprecated Transport.CancelRequest into a no-op
  • Drops the per-request mutex + map bookkeeping from the roundTrip hot path

Impact

  • Behavior change: after syncing, the deprecated Transport.CancelRequest stops working. Users should migrate to context cancellation (NewRequestWithContext), which req already supports.
  • Minor performance benefit: no per-request registration under reqMu.
  • Not a security fix.

Other commits since the last baseline (no impact)

  • 0d6e66c net/http/internal/http2: per-Server error channel pool — server.go is not inlined by req
  • ef00dcf httputil/reverseproxy: preserve original header on 1xx — reverseproxy is not inlined
  • f50b1aa net/http: enable more HTTP/3 tests — test-only
  • 56fb6d1 net/http: return non-nil Response from ClientConn ping requests — clientconn.go bridge is not inlined (req uses its own legacy ClientConn)

Suggested action

Sync a0f3b6a into root transport.go (keeping req customizations) via the usual merge upstream net/http procedure.

Contributor guide

No contributing guide indexed for this repository

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 by comparing root transport.go with Go stdlib commit a0f3b6a and review the usual “merge upstream net/http” procedure. Inspect req’s customizations around Transport.reqMu, Transport.reqCanceler, prepareTransportCancel, CancelRequest, and roundTrip. Done means the upstream cancellation changes are synced without losing req customizations, with context cancellation still supported and CancelRequest becoming a no-op.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, networking
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.