protocol: fix FetchService race where 2 subscribers want different refs
On Mac OS we are seeing failures on the e2e outdated sigrefs tests. After investigation its found that you can have a race condition where 2 fetches for example are created; one for ‘sigrefs’ and the other for ‘all’. Before the ‘sigrefs’ fetcher completes the FetcherService subscribes the ‘all’ listener to the ‘sigrefs’ result causing the ‘all’ listener to panic because there are missing refs - and the ‘all’ fetch never happens.
Introduces a regression test and fix. We now include RefsAt as part of
the subscribers HashMap and filter more specifically for interested
listeners of the completed fetch.
1 file changed
+119
-4
993428df
→
613c4e83
modified crates/radicle-protocol/src/fetcher/service.rs
@@ -1,5 +1,6 @@
|
|
|
|
| + | |
|
|
|
|
|
@@ -14,7 +15,7 @@ use crate::fetcher::state::{command, event, Config, FetcherState, QueuedFetch};
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -87,13 +88,14 @@ impl<S> FetcherService<S> {
|
|
|
|
|
|
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -108,7 +110,41 @@ impl<S> FetcherService<S> {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -123,7 +159,7 @@ impl<S> FetcherService<S> {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -140,3 +176,82 @@ impl<S> FetcherService<S> {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |