Commit 118c31b
committed
gracefulswitch: Wait for all goroutines on close
Goroutines spawned during balancer swaps could outlive the call to
Balancer.Close(). Monitor these via a wait group and wait for them to
finish before returning from Close(). This prevents any noticeable side
effects that could otherwise occur after Close() returns.
RELEASE NOTES:
- Closing a graceful switch balancer will now block until all pending
goroutines complete.
Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>1 parent 647162c commit 118c31b
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| 83 | + | |
79 | 84 | | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
274 | 280 | | |
275 | 281 | | |
276 | 282 | | |
| 283 | + | |
277 | 284 | | |
278 | 285 | | |
279 | 286 | | |
| |||
324 | 331 | | |
325 | 332 | | |
326 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
327 | 337 | | |
| 338 | + | |
| 339 | + | |
328 | 340 | | |
329 | 341 | | |
330 | 342 | | |
| |||
0 commit comments