From 5f8bd417259cce7ef8f97e06297edb17086f23c3 Mon Sep 17 00:00:00 2001 From: Alex Chi Z Date: Fri, 21 Jul 2023 16:12:03 -0400 Subject: [PATCH] address comments Signed-off-by: Alex Chi Z --- pageserver/src/tenant/mgr.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pageserver/src/tenant/mgr.rs b/pageserver/src/tenant/mgr.rs index e6e1860f4f..280bcaeb4a 100644 --- a/pageserver/src/tenant/mgr.rs +++ b/pageserver/src/tenant/mgr.rs @@ -368,9 +368,6 @@ pub async fn create_tenant( ctx, )?; - // TODO: tenant object & its background loops remain, untracked in tenant map, if we fail here. - // See https://github.com/neondatabase/neon/issues/4233 - // Put all code that might error into the check function. let check = || { @@ -388,6 +385,8 @@ pub async fn create_tenant( }; if let Err(e) = check() { + // schedule_local_tenant_processing eventually launches the tenant's background task + // We need to shut them down before bailing out. created_tenant.set_broken("failed to create".into()).await; return Err(e); } @@ -636,8 +635,6 @@ pub async fn attach_tenant( None, ctx, )?; - // TODO: tenant object & its background loops remain, untracked in tenant map, if we fail here. - // See https://github.com/neondatabase/neon/issues/4233 // Put all code that might error in the check function. @@ -651,6 +648,8 @@ pub async fn attach_tenant( }; if let Err(e) = check() { + // schedule_local_tenant_processing eventually launches the tenant's background task + // We need to shut them down before bailing out. attached_tenant.set_broken("failed to create".into()).await; return Err(e); }