Commit 93d49b4
authored
## Summary
- Propagate `_abortException` instead of `ObjectDisposedException` in
`Http2Connection.SetupAsync` catch block, surfacing the actual failure
reason (e.g., server-initiated disconnect) instead of a generic ODE
- Add test verifying that server disconnect during HTTP/2 setup
propagates a meaningful exception
## Details
When `ProcessIncomingFramesAsync` detects a server-initiated disconnect
and calls `Abort()`, the original failure reason is stored in
`_abortException`. However, `SetupAsync`'s catch block (line 258) was
wrapping the uninformative `ObjectDisposedException` instead of the
actual cause.
This change uses `_abortException ?? e` as the inner exception,
consistent with the existing pattern in `PerformWriteAsync` (line 1192)
and `AddStream` (line 1598).
## Test plan
- [x] New test:
`ServerDisconnectDuringSetup_PropagatesMeaningfulException`
- [x] All existing Http2 tests pass (858 passed, 9 skipped, 0 failed)
Fixes #119022
1 parent 23bc7e3 commit 93d49b4
File tree
2 files changed
+46
-2
lines changed- src/libraries/System.Net.Http
- src/System/Net/Http/SocketsHttpHandler
- tests/FunctionalTests
2 files changed
+46
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
260 | 262 | | |
261 | 263 | | |
262 | 264 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
690 | 732 | | |
691 | 733 | | |
692 | 734 | | |
| |||
0 commit comments