Fix hang after storing
continuous-integration/drone the build failed
Details
continuous-integration/drone the build failed
Details
This commit is contained in:
parent
155d31626e
commit
8eeafa7626
|
@ -258,7 +258,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "datman"
|
||||
version = "0.5.0-alpha.1"
|
||||
version = "0.5.0-alpha.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arc-interner",
|
||||
|
@ -1218,7 +1218,7 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
|||
|
||||
[[package]]
|
||||
name = "yama"
|
||||
version = "0.5.0-alpha.1"
|
||||
version = "0.5.0-alpha.2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"blake",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "datman"
|
||||
version = "0.5.0-alpha.1"
|
||||
version = "0.5.0-alpha.2"
|
||||
authors = ["Olivier 'reivilibre' <olivier@librepush.net>"]
|
||||
edition = "2018"
|
||||
repository = "https://bics.ga/reivilibre/yama"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "yama"
|
||||
version = "0.5.0-alpha.1"
|
||||
version = "0.5.0-alpha.2"
|
||||
authors = ["Olivier 'reivilibre' <olivier@librepush.net>"]
|
||||
edition = "2018"
|
||||
description = "Deduplicated, compressed and encrypted content pile manager"
|
||||
|
|
|
@ -273,6 +273,8 @@ pub fn store_fully<PT: ProgressTracker>(
|
|||
progress_bar,
|
||||
num_workers,
|
||||
)?;
|
||||
// must drop the pipeline to allow the threads to close
|
||||
drop(pipeline);
|
||||
while let Ok(_) = control_rx.recv() {
|
||||
// TODO nothing for now.
|
||||
}
|
||||
|
|
|
@ -94,14 +94,17 @@ pub fn existence_checker_stage<RP: RawPile>(
|
|||
let next_stage = next_stage.clone();
|
||||
let rx = rx.clone();
|
||||
let pile = pile.clone();
|
||||
std::thread::spawn(move || {
|
||||
std::thread::Builder::new()
|
||||
.name("yama exist?er".to_string())
|
||||
.spawn(move || {
|
||||
while let Ok((chunk_id, chunk)) = rx.recv() {
|
||||
// TODO handle errors properly
|
||||
if !pile.chunk_exists(&chunk_id).unwrap() {
|
||||
next_stage.send((chunk_id, chunk)).unwrap();
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
tx
|
||||
|
|
|
@ -269,7 +269,9 @@ impl<R: RawPile> RawPile for RawPileCompressor<R> {
|
|||
let receiver = receiver.clone();
|
||||
let controller_send = controller_send.clone();
|
||||
let this = (*self).clone();
|
||||
thread::spawn(move || {
|
||||
thread::Builder::new()
|
||||
.name(format!("yama Pcomp{}", compressor_number))
|
||||
.spawn(move || {
|
||||
let worker_id = Arc::new(format!("compressor-{}", compressor_number));
|
||||
if let Err(err) = this.storage_pipeline_worker(
|
||||
subsequent_pipeline,
|
||||
|
@ -283,7 +285,8 @@ impl<R: RawPile> RawPile for RawPileCompressor<R> {
|
|||
})
|
||||
.expect("This is BAD: failed to send failure message to controller.");
|
||||
}
|
||||
});
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
Ok(input_to_this_stage)
|
||||
|
|
|
@ -126,7 +126,9 @@ impl<RP: RawPile> RawPile for RawPileIntegrityChecker<RP> {
|
|||
.underlying
|
||||
.build_storage_pipeline(settings, controller_send)?;
|
||||
let (input, receiver) = crossbeam_channel::bounded::<(ChunkId, Vec<u8>)>(64);
|
||||
std::thread::spawn(move || {
|
||||
std::thread::Builder::new()
|
||||
.name("yama integrity".to_string())
|
||||
.spawn(move || {
|
||||
while let Ok((chunk_id, mut chunk)) = receiver.recv() {
|
||||
let mut hasher = twox_hash::XxHash64::with_seed(XXH64_SEED);
|
||||
hasher.write(&chunk);
|
||||
|
@ -134,7 +136,8 @@ impl<RP: RawPile> RawPile for RawPileIntegrityChecker<RP> {
|
|||
chunk.extend_from_slice(&computed_hash);
|
||||
next_stage.send((chunk_id, chunk)).unwrap();
|
||||
}
|
||||
});
|
||||
})
|
||||
.unwrap();
|
||||
Ok(input)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue