Skip to content

[HTTP] Use smaller Uri size in 32bit process - #137992

Merged
ManickaP merged 1 commit into
dotnet:mainfrom
ManickaP:fix-largeuri
Nov 23, 2026
Merged

ManickaP merged 1 commit into
dotnet:mainfrom
ManickaP:fix-largeuri

Conversation

@ManickaP

Copy link
Copy Markdown
Member

Fixes #137274
Fixes #137889

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@ManickaP

Copy link
Copy Markdown
Member Author

/ba-g unrelated

@ManickaP
ManickaP merged commit a209566 into dotnet:main Nov 23, 2026
64 of 67 checks passed
@ManickaP
ManickaP deleted the fix-largeuri branch November 23, 2026 10:36
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 24, 2026
lewing added a commit that referenced this pull request Nov 25, 2026
<!-- copilot-assessment:v1 -->
### Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: `29ccd413b6a52112d08e7acc20fc07f07f9c9bc3`

| Dimension | Assessment | Rationale |
|---|---|---|
| Change confidence | 8/10 | ↑ Exact one-line upstream port;
zero-context patch IDs match; static sizing checks cover all eight
condition combinations.<br>↓ No compilation, functional test run, or
backport CI run. |
| Diagnosis confidence | 9/10 | ↑ Linked issues report
OutOfMemoryException in this test on x86; its existing
10,000,000-character inputs impose substantial allocation pressure.<br>↓
Failure not reproduced locally. |
| Evidence fit | 8/10 | ↑ Source PR fixes the linked large-URI/header
OOM reports and adds this same 32-bit size limit.<br>↓ No x86 execution
of this backport. |
<!-- /copilot-assessment -->

Fixes Issue <!-- Issue Number --> Related to #137274 and #137889
(already addressed on main).

main PR <!-- Link to PR if any that fixed this in the main branch. -->
#137992

# Description

<!-- Give a brief summary of the issue and how the pull request is
fixing it. -->

Test-only backport of a209566.
In `LargeUriAndHeaders_Works`, use 100,000-character inputs for 32-bit
processes instead of the 10,000,000-character fallback.
Preserve WinHttp's 65,000-character limit, Android's 100,000-character
limit, the 64-bit fallback, and all test assertions.
Only
`src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.cs`
changes; no product code changes.

# Customer Impact

<!-- What is the impact to customers of not taking this fix? -->

No shipped behavior changes. Without this fix, oversized test inputs can
exhaust the 32-bit address space and produce unrelated CI failures.

# Regression

<!-- Is this fixing a problem that was introduced in the most recent
release, ie., fixing a regression? -->

Test reliability fix. The reports establish x86 OOM failures, but do not
establish when the problem was introduced.

# Testing

<!-- What kind of testing has been done with the fix. -->

- `git diff --check` and `git diff HEAD^ HEAD --check`: passed.
- A local Python static-validation script verified exact one-line scope,
matching upstream/backport stable patch IDs with zero context, and all
eight combinations of WinHttp, Android, and 32-bit sizing conditions:
passed. This modeled conditional selection; it did not compile or
execute C#.
- Identified both consumers: `System.Net.Http.Functional.Tests` and
`System.Net.Http.WinHttpHandler.Functional.Tests`.
- No build or functional tests run. This worktree lacks a built testhost
and repository-local SDK; the affected Windows x86 execution is
unavailable on this Mac. The user permitted skipping the full baseline
for this test-only servicing change.
- A targeted `LargeUriAndHeaders_Works` run remains unverified. PR CI is
intended to provide compilation and functional verification; no backport
CI has been inspected.

# Risk

<!-- Please assess the risk of taking this fix. Provide details backing
up your assessment. -->

Low risk: exact one-line upstream test-only backport using an existing
platform helper. WinHttp and Android limits retain precedence. All
assertions remain enabled. Tradeoff: non-Android, non-WinHttp 32-bit
runs exercise a smaller input; 64-bit runs retain the existing large
input.

# Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

> [!NOTE]
> This PR description and backport were prepared with GitHub Copilot.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants