Add a way to signal shutdown to snapshotting threads (#10744)

* Add a way to signal shutdown to snapshotting threads

* Pass Progress to fat_rlps() so we can abort from there too.

* Checking for abort in a single spot

* Remove nightly-only weak/strong counts

* fix warning

* Fix tests

* Add dummy impl to abort snapshots

* Add another dummy impl for TestSnapshotService

* Remove debugging code

* Return error instead of the odd Ok(())
Switch to AtomicU64
This commit is contained in:
David
2019-06-19 10:13:09 +02:00
committed by Andronik Ordian
parent be5db14160
commit d2120ded56
15 changed files with 167 additions and 78 deletions

View File

@@ -122,6 +122,8 @@ impl SnapshotService for TestSnapshotService {
self.block_restoration_chunks.lock().clear();
}
fn abort_snapshot(&self) {}
fn restore_state_chunk(&self, hash: H256, chunk: Bytes) {
if self.restoration_manifest.lock().as_ref().map_or(false, |m| m.state_hashes.iter().any(|h| h == &hash)) {
self.state_restoration_chunks.lock().insert(hash, chunk);