Repository navigation
Commit 247f6a7
Avoid early HTTP/2 teardown in WinHTTP Latin1 header test (#133955)
## Summary
Keep the HTTP/2 loopback connection alive until the Latin1 header test's
buffered `HttpClient.SendAsync` and client disposal finish. The previous
helper starts server-side send shutdown immediately after writing the
final response, potentially racing pending WinHTTP native I/O.
The new path is limited to **WinHTTP HTTP/2 in this one header-encoding
theory**. It preserves request-body consumption, GOAWAY-before-response
ordering, the empty 200/END_STREAM response, and all raw Latin1/Huffman
header assertions. Client completion is signaled in `finally`; server
failure cancels the request **before** asynchronous connection disposal.
HTTP/1 and Sockets retain the existing server helper.
There is no production change, retry, native-error suppression, timeout
increase, test disabling, or change to global loopback teardown
defaults.
## Evidence and limits
The supplied [CoreCLR build
1594333](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1594333),
revision `6ed2ba318dcaa936da60f7d6bc9eb30cad54fc0c`, failed the
Content/0x7f case with native 12030 during response buffering: [same-run
console](https://helixr18s23ayyejvk1x8qcc.blob.core.windows.net/dotnet-runtime-refs-heads-main-a2037c901dc94f1d88/System.Net.Http.WinHttpHandler.Functional.Tests/1/console.55c334a6.log?helixlogtype=result).
- Directly invoking the **unchanged archived CI test method** reproduced
`API_QUERY_DATA_AVAILABLE / WINHTTP_CONNECTION_ERROR(12030)` at call
686.
- A controlled reconstruction using those archived assemblies compared
immediate shutdown with waiting for buffered client completion: **1
native 12030 in 10,000 ungated calls; 0 in 10,000 gated calls**. That
controlled failure was at **API_WRITE_DATA**, not
API_QUERY_DATA_AVAILABLE. Observer timestamps show server END_STREAM and
send shutdown before the request-error callback.
- The different native API phases and sparse failure count matter: this
supports removing the test's unnecessary teardown race, but does **not**
prove the internal native cause of the original CI failure or
elimination of all WinHTTP 12030s. A separate bounded
header-callback-delay experiment passed both arms and was inconclusive.
This is a test-lifetime correction for header encoding, not a change to
how WinHTTP handles arbitrary server disconnects.
Cookie/client-certificate 12030s and badssl 12152/12002 diagnostics
remain separate.
## Local validation
Windows 11 build 26100, x64 CoreCLR Release with locally built Debug
libraries/tests; actual runtime 12.0.0, test TFM net11.0-windows. Reused
the successful clr+libs baseline through a subst path.
| Final-source validation | Result |
|---|---|
| WinHTTP full functional suite, CoreCLR | 1,631 passed, 41 existing
skips, zero failures |
| WinHTTP full functional suite, .NET Framework net481 | 639 passed, 28
existing skips, zero failures |
| Actual fixed Content/0x7f method, filtered native tracing enabled |
10,000/10,000 passed |
| Shared Sockets Latin1 theory, unmodified HEAD and final source | Both
70 passed / same two HTTP/1 host-software-aborted failures |
The Sockets async failure is tracked by #132004; its sync counterpart
had the same signature. Both were reproduced with the unmodified HEAD
test compiled via an artifact-only source override. Neither failure
enters the new WinHTTP HTTP/2 branch, and neither was suppressed.
Artifact-only failure injection into the retained method also exercised
success, client assertion failure, server failure before/after the
response, cancellation with an established connection, client timeout,
and completion-gate timeout. All seven preserved their expected outcomes
and completed both cleanup paths, including awaited server disposal,
within 0.7 seconds. The final uninstrumented source was then explicitly
rebuilt and the full suites and 10,000-call replay run again. Final
WinHTTP build: zero warnings/errors.
No x86, NativeAOT, older-Windows, or non-Windows execution is claimed.
Framework coverage compiles the shared change but does not execute the
HTTP/2 gate. Existing graceful-disposal/factory timeout limitations are
not globally hardened by this patch.
Resolves #130458
> [!NOTE]
> This change and description were developed with GitHub Copilot;
validation results were collected locally.
Co-authored-by: Copilot App <[email protected]>1 parent 0b942f4 commit 247f6a7
1 file changed
Lines changed: 63 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2248 | 2248 | | |
2249 | 2249 | | |
2250 | 2250 | | |
| 2251 | + | |
| 2252 | + | |
2251 | 2253 | | |
2252 | 2254 | | |
2253 | | - | |
2254 | | - | |
| 2255 | + | |
2255 | 2256 | | |
2256 | | - | |
2257 | | - | |
2258 | | - | |
| 2257 | + | |
| 2258 | + | |
2259 | 2259 | | |
2260 | | - | |
2261 | | - | |
2262 | | - | |
2263 | | - | |
2264 | | - | |
2265 | | - | |
2266 | | - | |
2267 | | - | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
2268 | 2272 | | |
2269 | | - | |
| 2273 | + | |
2270 | 2274 | | |
2271 | | - | |
2272 | | - | |
2273 | | - | |
2274 | | - | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
2275 | 2279 | | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
2279 | 2284 | | |
2280 | 2285 | | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
2281 | 2290 | | |
2282 | 2291 | | |
2283 | | - | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
| 2309 | + | |
| 2310 | + | |
| 2311 | + | |
| 2312 | + | |
| 2313 | + | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
2284 | 2325 | | |
2285 | 2326 | | |
2286 | 2327 | | |
| |||
0 commit comments