This repository was archived by the owner on Apr 29, 2020. It is now read-only.
Commit 0918e7e
committed
DS farm: buffer per-DS update channel
Occasionally the daemon set farm locks up with the farm goroutine
blocking forever attempting to send an update to a daemon set worker
goroutine. This can happen due to a race where the worker thread might
exit for a number of reasons after the farm goroutine checks the child
map to determine a worker already exists but before sending an update.
This commit sidesteps the problem by buffering the per-daemon set update
channel so that the farm goroutine will never block sending to a worker.
If a worker dies, an existing routine grabs a mutex protecting the child
map and clears out the child entry and drains the buffered channel. The
next time an update is seen for the daemon set, the farm loop should
know that it needs to spawn another worker.1 parent 33207df commit 0918e7e
1 file changed
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
| |||
560 | 564 | | |
561 | 565 | | |
562 | 566 | | |
563 | | - | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
564 | 570 | | |
565 | 571 | | |
566 | 572 | | |
| |||
733 | 739 | | |
734 | 740 | | |
735 | 741 | | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
736 | 750 | | |
737 | 751 | | |
738 | 752 | | |
| |||
0 commit comments