Commit bdbd1b2
Fix critical SignalR connection recovery issue
This commit fixes a critical bug where the SignalR connection would not recover after the automatic reconnect mechanism exhausted its retry attempts. This caused services using SignalRHostedService to permanently lose connectivity and require manual restart.
Changes:
- Added automatic reconnection logic in the Closed event handler
- When connection closes unexpectedly, it now triggers ExecuteStartUp() which uses the Polly retry policy with infinite retries
- Added semaphore lock to prevent multiple simultaneous reconnection attempts
- Added isShuttingDown flag to prevent reconnection during graceful shutdown
- Improved logging for connection lifecycle events
This resolves the issue where services would crash with WebSocketException and require manual restart when network connectivity was temporarily lost.
Version bumped to 2.2.3
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent d0bbb1e commit bdbd1b2
File tree
2 files changed
+43
-5
lines changed- ProReception.DistributionServerInfrastructure/HostedServices
2 files changed
+43
-5
lines changedLines changed: 42 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
170 | | - | |
| 175 | + | |
171 | 176 | | |
172 | | - | |
173 | | - | |
174 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
175 | 213 | | |
176 | 214 | | |
177 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
0 commit comments