Commit 2c580ed
dovtang
fix: prevent service degradation on config reload failure
When applyConfig() fails during hot reload, the old proxy was being destroyed
before the new proxy was successfully initialized, causing partial service outage.
Changes:
- main.go: Use temporary variable to create and validate new proxy before
replacing the global instance. On failure, cleanup new proxy and keep
old proxy running.
- proxy.go: Fix bug where maxIdleConns was incorrectly assigned MaxIdleConnsPerHost1 parent 3aea406 commit 2c580ed
2 files changed
Lines changed: 20 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
307 | 320 | | |
| 321 | + | |
308 | 322 | | |
309 | 323 | | |
310 | 324 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
0 commit comments