From b15499251086183b073ef893c3852a138ee3f919 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 2 Nov 2022 12:06:10 +0100 Subject: [PATCH] timeline_list_handler: avoid spawn_blocking As per https://github.com/neondatabase/neon/issues/2731#issuecomment-1299335813 refs https://github.com/neondatabase/neon/issues/2731 --- pageserver/src/http/routes.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index e8a160e395..d88cf6e075 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -227,13 +227,10 @@ async fn timeline_list_handler(request: Request) -> Result, let state = get_state(&request); - let timelines = tokio::task::spawn_blocking(move || { - let _enter = info_span!("timeline_list", tenant = %tenant_id).entered(); + let timelines = info_span!("timeline_list", tenant = %tenant_id).in_scope(|| { let tenant = tenant_mgr::get_tenant(tenant_id, true).map_err(ApiError::NotFound)?; Ok(tenant.list_timelines()) - }) - .await - .map_err(|e: JoinError| ApiError::InternalServerError(e.into()))??; + })?; let mut response_data = Vec::with_capacity(timelines.len()); for timeline in timelines {