node: duplicate fetching logic respects RefsAt
Two concurrent fetches can occur from the same peer, while also being
for a different set of references. This was seen in the
test_outdated_sigrefs test. Alice would have an ongoing fetch from
Eve, and concurrently, Eve will create a new issue – thus creating a
new RefsAt message – and Alice would attempt to fetch this.
The previous logic would only check that Alice is fetching from Eve
and ignore the new updates – meaning the test could fail. However, if
the RefsAt are checked then the other fetch can be recognised as
new, and queue it.
2 files changed
+16
-6
13d5b4f6
→
bb4ed84b
modified radicle-node/src/service.rs
@@ -249,6 +249,8 @@ enum TryFetchError<'a> {
|
|
|
|
|
|
| + | |
| + | |
|
|
|
|
|
@@ -837,10 +839,12 @@ where
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -912,6 +916,7 @@ where
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified radicle-node/src/tests/e2e.rs
@@ -1,7 +1,6 @@
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -9,6 +8,7 @@ use radicle::storage::{
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -969,7 +969,7 @@ fn test_outdated_sigrefs() {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -984,6 +984,11 @@ fn test_outdated_sigrefs() {
|
|
|
|
|
|
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|