Commit cfd1531
committed
NRG: Don't drain response or proposal queues when switching to leader
The `runAsCandidate` and `runAsFollower` goroutines both try to drain
the append entry response and proposal queues if they are still populated
from the previous leadership, but we might be blocked in `runAsCandidate`
or `runAsFollower` while switching to leader waiting for the state change
to complete and accidentally drain incoming proposals.
Signed-off-by: Neil Twigg <[email protected]>1 parent 1723f25 commit cfd1531
2 files changed
+37
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
233 | 248 | | |
234 | 249 | | |
235 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2261 | 2261 | | |
2262 | 2262 | | |
2263 | 2263 | | |
2264 | | - | |
| 2264 | + | |
2265 | 2265 | | |
2266 | 2266 | | |
2267 | | - | |
| 2267 | + | |
2268 | 2268 | | |
2269 | 2269 | | |
2270 | 2270 | | |
| |||
2275 | 2275 | | |
2276 | 2276 | | |
2277 | 2277 | | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
2278 | 2296 | | |
2279 | 2297 | | |
2280 | 2298 | | |
| |||
3412 | 3430 | | |
3413 | 3431 | | |
3414 | 3432 | | |
3415 | | - | |
| 3433 | + | |
3416 | 3434 | | |
3417 | 3435 | | |
3418 | | - | |
| 3436 | + | |
3419 | 3437 | | |
3420 | 3438 | | |
3421 | 3439 | | |
| |||
0 commit comments