Commit 9c334ed
Fix gRPC
* Improved streaming of pluggable-discoveries events (WIP)
Now the DiscoveryManager is able to start the discoveries and add/remove
them in a thread-safe way. Also the watchers may connect and disconnect
seamlessly at any time, the incoming events from the discovery are
broadcasted correctly to each active watcher.
This refactoring dramatically simplifies the DiscoveryManager design.
* Added discovery id in discovery.Event struct
* Cache active ports and transmit them when a new watcher connects
* Correctly handle discovery cleanup
* Fixed wrong test
* Correctly handle discovery cleanup and re-add
* Added some doc comments in the source code
* Move Unlock under defer
* Factored subrotuine into a function
it will be useful in the next commits.
* Do not cache ports in the DiscoveryClient
there is already a cache in the DiscoveryManager there is no need to
duplicate it.
* Discovery: eventChan must be protected by mutex when doing START_SYNC
otherwise the discovery may send some events before the eventChan is
setup (and those events will be lost)
* Increased error level for logging watchers that lags
* Updated discvoery_client to the latest API
* Report discovery start errors
* Update arduino/discovery/discovery_client/main.go
Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com>
Co-authored-by: Umberto Baldi <34278123+umbynos@users.noreply.github.com>BoardList* methods concurrency issues (#1804)1 parent 312cfdb commit 9c334ed
File tree
10 files changed
+289
-404
lines changed- arduino
- cores/packagemanager
- discovery
- discovery_client
- discoverymanager
- cli
- arguments
- board
- commands
- board
- daemon
10 files changed
+289
-404
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | | - | |
333 | | - | |
| 332 | + | |
| 333 | + | |
334 | 334 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
| 335 | + | |
339 | 336 | | |
340 | | - | |
341 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
342 | 340 | | |
343 | 341 | | |
344 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
121 | 120 | | |
122 | 121 | | |
123 | 122 | | |
124 | | - | |
125 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
| |||
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
179 | | - | |
180 | 178 | | |
181 | | - | |
| 179 | + | |
182 | 180 | | |
183 | 181 | | |
184 | 182 | | |
| |||
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
190 | | - | |
191 | 188 | | |
192 | | - | |
| 189 | + | |
193 | 190 | | |
194 | 191 | | |
195 | 192 | | |
| |||
276 | 273 | | |
277 | 274 | | |
278 | 275 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 276 | + | |
283 | 277 | | |
284 | 278 | | |
285 | 279 | | |
| |||
366 | 360 | | |
367 | 361 | | |
368 | 362 | | |
369 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
370 | 369 | | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
375 | | - | |
376 | 374 | | |
377 | 375 | | |
378 | 376 | | |
| |||
409 | 407 | | |
410 | 408 | | |
411 | 409 | | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
412 | 413 | | |
413 | 414 | | |
414 | 415 | | |
| |||
423 | 424 | | |
424 | 425 | | |
425 | 426 | | |
426 | | - | |
427 | | - | |
428 | 427 | | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
| 428 | + | |
| 429 | + | |
435 | 430 | | |
436 | 431 | | |
437 | 432 | | |
438 | 433 | | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 36 | + | |
| 37 | + | |
52 | 38 | | |
| 39 | + | |
53 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
| |||
66 | 58 | | |
67 | 59 | | |
68 | 60 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
| |||
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
126 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | 135 | | |
0 commit comments