Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sync-propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Oct 8, 2023
2 parents 44a6155 + 898b0f7 commit 0f3c06b
Show file tree
Hide file tree
Showing 35 changed files with 631 additions and 1,027 deletions.
33 changes: 32 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion iroh-bytes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ flume = "0.10.14"
futures = "0.3.25"
genawaiter = { version = "0.99.1", features = ["futures03"] }
hex = "0.4.3"
iroh-io = { version = "0.3.0" }
iroh-io = { version = "0.3.0", features = ["stats"] }
multibase = "0.9.1"
num_cpus = "1.15.0"
once_cell = "1.17.0"
Expand Down
10 changes: 4 additions & 6 deletions iroh-bytes/src/baomap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::{collections::BTreeSet, io, path::PathBuf, sync::Arc};

use crate::{
collection::CollectionParser,
hashseq::parse_hash_seq,
util::{
progress::{IdGenerator, ProgressSender},
BlobFormat, HashAndFormat, RpcError, Tag,
Expand Down Expand Up @@ -234,11 +234,10 @@ pub trait Store: ReadableStore + PartialMap {
/// in the gc_sweep phase.
fn gc_mark<'a>(
&'a self,
cp: impl CollectionParser + 'a,
extra_roots: impl IntoIterator<Item = io::Result<HashAndFormat>> + 'a,
) -> LocalBoxStream<'a, GcMarkEvent> {
Gen::new(|co| async move {
if let Err(e) = gc_mark_task(self, cp, extra_roots, &co).await {
if let Err(e) = gc_mark_task(self, extra_roots, &co).await {
co.yield_(GcMarkEvent::Error(e)).await;
}
})
Expand Down Expand Up @@ -367,7 +366,6 @@ impl Drop for TempTag {
/// Implementation of the gc method.
async fn gc_mark_task<'a>(
store: &'a impl Store,
cp: impl CollectionParser + 'a,
extra_roots: impl IntoIterator<Item = io::Result<HashAndFormat>> + 'a,
co: &Co<GcMarkEvent>,
) -> anyhow::Result<()> {
Expand Down Expand Up @@ -418,11 +416,11 @@ async fn gc_mark_task<'a>(
warn!("gc: {} creating data reader failed", hash);
continue;
};
let Ok((mut iter, stats)) = cp.parse(reader).await else {
let Ok((mut iter, count)) = parse_hash_seq(reader).await else {
warn!("gc: {} parse failed", hash);
continue;
};
info!("parsed collection {} {:?}", hash, stats);
info!("parsed collection {} {:?}", hash, count);
loop {
let item = match iter.next().await {
Ok(Some(item)) => item,
Expand Down
199 changes: 0 additions & 199 deletions iroh-bytes/src/collection.rs

This file was deleted.

Loading

0 comments on commit 0f3c06b

Please sign in to comment.