From 590f894db8bb48d7e7d2298853e514d516c5fd55 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 2 Nov 2022 11:33:46 +0100 Subject: [PATCH] tenant_status: remove unnecessary spawn_blocking The spawn_blocking is pointless in this cases: get_tenant is not expected to block for any meaningful amount of time. There are get_tenant calls in most other functions in the file too, and they don't bother with spawn_blocking. Let's remove the spawn_blocking from tenant_status, too, to be consistent. fixes https://github.com/neondatabase/neon/issues/2731 --- pageserver/src/http/routes.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index 8ec7604b8a..e8a160e395 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -523,9 +523,7 @@ async fn tenant_status(request: Request) -> Result, ApiErro check_permission(&request, Some(tenant_id))?; // if tenant is in progress of downloading it can be absent in global tenant map - let tenant = tokio::task::spawn_blocking(move || tenant_mgr::get_tenant(tenant_id, false)) - .await - .map_err(|e: JoinError| ApiError::InternalServerError(e.into()))?; + let tenant = tenant_mgr::get_tenant(tenant_id, false); let state = get_state(&request); let remote_index = &state.remote_index;