Commit 8ad2b37
Ben Reed
Fix blocking issue with multiple sessions
When multiple sessions were run serially, the second would block
forever. The Watcher type sends Kubernetes events for a specific
session over a channel to the executor. During clean-up the Watcher
continued to post events, but the executor never read these. Since the
Watcher used an unbuffered channel, it blocked until it was read. This
blocking caused a lock to never be released. This lock was needed to
create a new channel for a new session.
This change switches the Watcher to use a buffered channel which does
not block until it is full. The Watcher is also modified to drop events
when the channel's capacity is exceeded. This prevents it from blocking
during manual tests and allows additional sessions to be scheduled.
In addition, this change adds a missing call to (*queue).Done in the
controller. This call is necessary to instruct the reservation system
that machines are available for scheduling.1 parent ecbaf9f commit 8ad2b37
3 files changed
+18
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
137 | 146 | | |
138 | 147 | | |
139 | 148 | | |
| |||
192 | 201 | | |
193 | 202 | | |
194 | 203 | | |
| 204 | + | |
| 205 | + | |
0 commit comments