From 796ee4d8af01f3a56eab74d4e3e86b95c5a29c92 Mon Sep 17 00:00:00 2001 From: Bojan Serafimov Date: Fri, 24 Jun 2022 10:29:42 -0400 Subject: [PATCH] Instrument the task, not the await --- pageserver/src/tenant_threads.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pageserver/src/tenant_threads.rs b/pageserver/src/tenant_threads.rs index e6674a32b9..2b82b706fc 100644 --- a/pageserver/src/tenant_threads.rs +++ b/pageserver/src/tenant_threads.rs @@ -146,8 +146,8 @@ pub fn init_tenant_task_pool() -> anyhow::Result<()> { // Spawn new task, request cancellation of the old one if exists let (cancel_send, cancel_recv) = watch::channel(()); - let _handle = tokio::spawn(gc_loop(tenantid, cancel_recv)) - .instrument(trace_span!("gc loop", tenant = %tenantid)); + let _handle = tokio::spawn(gc_loop(tenantid, cancel_recv) + .instrument(trace_span!("gc loop", tenant = %tenantid))); if let Some(old_cancel_send) = gc_loops.insert(tenantid, cancel_send) { old_cancel_send.send(()).ok(); } @@ -157,8 +157,8 @@ pub fn init_tenant_task_pool() -> anyhow::Result<()> { // Spawn new task, request cancellation of the old one if exists let (cancel_send, cancel_recv) = watch::channel(()); - let _handle = tokio::spawn(compaction_loop(tenantid, cancel_recv)) - .instrument(trace_span!("compaction loop", tenant = %tenantid)); + let _handle = tokio::spawn(compaction_loop(tenantid, cancel_recv) + .instrument(trace_span!("compaction loop", tenant = %tenantid))); if let Some(old_cancel_send) = compaction_loops.insert(tenantid, cancel_send) { old_cancel_send.send(()).ok(); }