rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwooda3d163572aed7c48040e456a3dcb3fc38b66eb79
{
"request": "trigger",
"version": 1,
"event_type": "patch",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Created",
"patch": {
"id": "21e2f2866575a8fcff2b3af6190632d7611762cd",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"title": "node: duplicate fetching logic respects RefsAt",
"state": {
"status": "merged",
"conflicts": []
},
"before": "a48081f2717f069d456ec09f31d9e639b232dbed",
"after": "a3d163572aed7c48040e456a3dcb3fc38b66eb79",
"commits": [
"a3d163572aed7c48040e456a3dcb3fc38b66eb79"
],
"target": "d285eccb23f3986bfa88fc1af033e6dcb0dc3a65",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "21e2f2866575a8fcff2b3af6190632d7611762cd",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Two concurrent fetches can occur from the same peer, while also being\nfor a different set of references. This was seen in the\n`test_outdated_sigrefs` test. Alice would have an ongoing fetch from\nEve, and concurrently, Eve will create a new issue -- thus creating a\nnew `RefsAt` message -- and Alice would attempt to fetch this.\n\nThe previous logic would only check that Alice is fetching from Eve\nand ignore the new updates -- meaning the test could fail. However, if\nthe `RefsAt` are checked then the other fetch can be recognised as\nnew, and queue it.",
"base": "a48081f2717f069d456ec09f31d9e639b232dbed",
"oid": "a3d163572aed7c48040e456a3dcb3fc38b66eb79",
"timestamp": 1709218775
},
{
"id": "60cb9071d57c3d0a4c7cbad4846791aa19096dad",
"author": {
"id": "did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"alias": null
},
"description": "Rebase.",
"base": "13d5b4f62043b65aa4b7f31e4cb328c5c826afdc",
"oid": "bb4ed84b951608ee62123be1440c73fe9c646c26",
"timestamp": 1709988207
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "c777a2d0-37ed-4910-b050-1e4706058694"
},
"info_url": "https://cci.rad.levitte.org//c777a2d0-37ed-4910-b050-1e4706058694.html"
}
Started at: 2026-09-07 19:45:42.108102+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/c777a2d0-37ed-4910-b050-1e4706058694/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 189 issues · 38 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout 21e2f2866575a8fcff2b3af6190632d7611762cd
✓ Switched to branch patch/21e2f28 at revision 21e2f28
✓ Branch patch/21e2f28 setup to track rad/patches/21e2f2866575a8fcff2b3af6190632d7611762cd
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout a3d163572aed7c48040e456a3dcb3fc38b66eb79
HEAD is now at a3d16357 node: duplicate fetching logic respects RefsAt
Exit code: 0
$ rad patch show 21e2f2866575a8fcff2b3af6190632d7611762cd -p
╭────────────────────────────────────────────────────────────────────────────────╮
│ Title node: duplicate fetching logic respects RefsAt │
│ Patch 21e2f2866575a8fcff2b3af6190632d7611762cd │
│ Author fintohaps z6Mkire…SQZ3voM │
│ Head a3d163572aed7c48040e456a3dcb3fc38b66eb79 │
│ Base a48081f2717f069d456ec09f31d9e639b232dbed │
│ Target master │
│ Branches patch/21e2f28 │
│ Commits ahead 1, behind 1581 │
│ Status merged │
│ │
│ 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. │
├────────────────────────────────────────────────────────────────────────────────┤
│ a3d1635 node: duplicate fetching logic respects RefsAt │
├────────────────────────────────────────────────────────────────────────────────┤
│ ● Revision 21e2f28 @ a48081f..a3d1635 by fintohaps z6Mkire…SQZ3voM 2 years ago │
│ ↑ Revision 60cb907 @ 13d5b4f..bb4ed84 by cloudhead z6MksFq…bS9wzpT 2 years ago │
│ └─ ✓ merged by cloudhead z6MksFq…bS9wzpT │
╰────────────────────────────────────────────────────────────────────────────────╯
commit a3d163572aed7c48040e456a3dcb3fc38b66eb79
Author: Fintan Halpenny <fintan.halpenny@gmail.com>
Date: Thu Feb 29 14:55:27 2024 +0000
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.
Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
diff --git a/radicle-node/src/service.rs b/radicle-node/src/service.rs
index 22f6c38be..92fc7ddbf 100644
--- a/radicle-node/src/service.rs
+++ b/radicle-node/src/service.rs
@@ -249,6 +249,8 @@ enum TryFetchError<'a> {
struct FetchState {
/// Node we're fetching from.
from: NodeId,
+ /// What refs we're fetch from
+ refs_at: Vec<RefsAt>,
/// Channels waiting for fetch results.
subscribers: Vec<chan::Sender<FetchResult>>,
}
@@ -837,10 +839,12 @@ where
}
}
Err(TryFetchError::AlreadyFetching(fetching)) => {
- // If we're already fetching from the requested peer, there's nothing to do, we
- // simply add the supplied channel to the list of subscribers so that it is notified
- // on completion. Otherwise, we queue a fetch with the requested peer.
- if fetching.from == from {
+ // If we're already fetching the same refs from the
+ // requested peer, there's nothing to do, we simply
+ // add the supplied channel to the list of subscribers
+ // so that it is notified on completion. Otherwise, we
+ // queue a fetch with the requested peer.
+ if fetching.from == from && fetching.refs_at == refs_at {
debug!(target: "service", "Ignoring redundant fetch of {rid} from {from}");
if let Some(c) = channel {
@@ -912,6 +916,7 @@ where
let fetching = fetching.or_insert(FetchState {
from,
+ refs_at: refs_at.clone(),
subscribers: vec![],
});
let namespaces = self.policies.namespaces_for(&self.storage, &rid)?;
diff --git a/radicle-node/src/tests/e2e.rs b/radicle-node/src/tests/e2e.rs
index be513f25e..3712a2b06 100644
--- a/radicle-node/src/tests/e2e.rs
+++ b/radicle-node/src/tests/e2e.rs
@@ -1,7 +1,6 @@
use std::{collections::HashSet, thread, time};
use radicle::crypto::{test::signer::MockSigner, Signer};
-use radicle::git;
use radicle::node::{Alias, FetchResult, Handle as _, DEFAULT_TIMEOUT};
use radicle::storage::{
ReadRepository, ReadStorage, RefUpdate, RemoteRepository, SignRepository, ValidateRepository,
@@ -9,6 +8,7 @@ use radicle::storage::{
};
use radicle::test::fixtures;
use radicle::{assert_matches, rad};
+use radicle::{git, issue};
use crate::node::config::Limits;
use crate::node::{Config, ConnectOptions};
@@ -969,7 +969,7 @@ fn test_outdated_sigrefs() {
// At this stage, Alice and Bob have Eve's fork and Eve does not
// have Bob's fork
- eve.issue(
+ let issue_id = eve.issue(
rid,
"Outdated Sigrefs",
"Outdated sigrefs are harshing my vibes",
@@ -984,6 +984,11 @@ fn test_outdated_sigrefs() {
FetchResult::Success { .. }
);
let repo = alice.storage.repository(rid).unwrap();
+ let issues = issue::Issues::open(&repo).unwrap();
+ assert!(
+ issues.get(&issue_id).unwrap().is_some(),
+ "Alice did not fetch issue {issue_id}"
+ );
let eve_remote = repo.remote(&eve.id).unwrap();
let eves_refs_expected = eve_remote.refs;
assert_ne!(eves_refs_expected, old_refs);
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny clippy::all cargo build --all-targets --workspace cargo doc --workspace cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name c777a2d0-37ed-4910-b050-1e4706058694 -v /opt/radcis/ci.rad.levitte.org/cci/state/c777a2d0-37ed-4910-b050-1e4706058694/s:/c777a2d0-37ed-4910-b050-1e4706058694/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/c777a2d0-37ed-4910-b050-1e4706058694/w:/c777a2d0-37ed-4910-b050-1e4706058694/w -w /c777a2d0-37ed-4910-b050-1e4706058694/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:trixie bash /c777a2d0-37ed-4910-b050-1e4706058694/s/script.sh
+ cargo --version
info: syncing channel updates for '1.74-x86_64-unknown-linux-gnu'
info: latest update on 2023-12-07, rust version 1.74.1 (a28077b28 2023-12-04)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
cargo 1.74.1 (ecb9851af 2023-10-18)
+ rustc --version
rustc 1.74.1 (a28077b28 2023-12-04)
+ cargo fmt --check
error: 'cargo-fmt' is not installed for the toolchain '1.74-x86_64-unknown-linux-gnu'.
To install, run `rustup component add --toolchain 1.74-x86_64-unknown-linux-gnu rustfmt`
Exit code: 1
{
"response": "finished",
"result": "failure"
}