]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/client/remote_chunk_reader.rs: use tokio::task::block_in_place to avoid blocking
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 16 Jan 2020 12:52:23 +0000 (13:52 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 16 Jan 2020 12:55:19 +0000 (13:55 +0100)
Else we block the current executor.

src/client/remote_chunk_reader.rs

index 6b419b1e79b45f3088172e785e3d953c3f2d30c3..aeb821832047a382b898462e8f78b943e3b43b76 100644 (file)
@@ -35,7 +35,7 @@ impl ReadChunk for RemoteChunkReader {
 
         let mut chunk_data = Vec::with_capacity(4*1024*1024);
 
-        futures::executor::block_on(self.client.download_chunk(&digest, &mut chunk_data))?;
+        tokio::task::block_in_place(|| futures::executor::block_on(self.client.download_chunk(&digest, &mut chunk_data)))?;
 
         let chunk = DataBlob::from_raw(chunk_data)?;
         chunk.verify_crc()?;