remove needless tokio spawn
@@ -334,12 +334,8 @@ impl BlockReader {
offset: u64,
length: u64,
) -> Result<(usize, Vec<u8>)> {
- let handler = common_base::base::tokio::spawn(async move {
let op = || async {
let mut chunk = vec![0; length as usize];
- // Sine error conversion DO matters: retry depends on the conversion
- // to distinguish transient errors from permanent ones.
- // Explict error conversfeat-bloom-switch-to-external-indexion is used here, to make the code easy to be followed
let mut r = o
.range_reader(offset..offset + length)
.await
@@ -357,16 +353,6 @@ impl BlockReader {
let chunk = op.retry_with_notify(notify).await?;
Ok((index, chunk))
- });
-
- match handler.await {
- Ok(Ok((index, data))) => Ok((index, data)),
- Ok(Err(cause)) => Err(cause),
- Err(cause) => Err(ErrorCode::TokioError(format!(
- "Cannot join future {:?}",
- cause
- ))),
- }
}
#[tracing::instrument(level = "debug", skip_all)]
