From 2b4c3cb9329046bdbbedf86ec1a2f3959d0c8b66 Mon Sep 17 00:00:00 2001 From: Bojan Serafimov Date: Tue, 28 Jun 2022 09:29:59 -0400 Subject: [PATCH] Handle errors on shutdown --- pageserver/src/tenant_tasks.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pageserver/src/tenant_tasks.rs b/pageserver/src/tenant_tasks.rs index bc49d98a12..68c2bba9f4 100644 --- a/pageserver/src/tenant_tasks.rs +++ b/pageserver/src/tenant_tasks.rs @@ -159,8 +159,17 @@ pub fn init_tenant_task_pool() -> anyhow::Result<()> { } // Exit after all tasks finish - // TODO log any errors - while let Some(_) = futures.next().await { } + while let Some(result) = futures.next().await { + match result { + Ok(()) => { + TENANT_TASK_EVENTS.with_label_values(&["stop"]).inc(); + }, + Err(e) => { + TENANT_TASK_EVENTS.with_label_values(&["panic"]).inc(); + error!("loop join error {}", e) + }, + } + } break; }, tenantid = gc_recv.recv() => {