Commit 0eb8b3f
Fail fast when the debug adapter's
OmniSharp's `DebugAdapterServer.From()` (0.19.9) awaits an internal
`AsyncSubject` that its `InitializeRequest` handler only signals on the
success path. If an `OnInitialize` delegate throws, the handler faults
before signaling, nothing errors the subject, and `From()` -- and thus
`PsesDebugServer.StartAsync()` -- awaits it forever. So a startup failure
wedges the entire debug server and rides the CI/job timeout instead of
failing fast. This is a library limitation, not our bug: the same code is
present on the library's `master`, so we can't fix it upstream without a
fork or upgrade.
#2328 fixes the specific trigger we hit on in-box Windows PowerShell (the
`Get-ExecutionPolicy -List` type-data conflict), but the wedge mechanism is
generic. Guard against any future `OnInitialize` failure: wrap the delegate
body, log the exception, and signal `_serverStopped` so `WaitForShutdown`
unblocks and the process exits cleanly. `Dispose`'s `_serverStopped`
completion is now idempotent (`TrySetResult`) since the catch may have
already completed it.
This converts a silent multi-hour hang into a clean termination with a
logged error -- the client sees the session end instead of waiting forever.
See #2323.
Drafted by Copilot (Claude Opus 4.8).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>OnInitialize delegate throws1 parent 71416ff commit 0eb8b3f
1 file changed
Lines changed: 35 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 94 | + | |
102 | 95 | | |
103 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
104 | 127 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 128 | | |
110 | 129 | | |
111 | 130 | | |
| |||
134 | 153 | | |
135 | 154 | | |
136 | 155 | | |
137 | | - | |
| 156 | + | |
138 | 157 | | |
139 | 158 | | |
140 | 159 | | |
| |||
0 commit comments