From 6ee24e1c0e2ba3df3b7d3ee7d4ee3a671bc42f44 Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Mon, 27 Sep 2021 16:03:26 -0700 Subject: [PATCH] minor tweaks to TEARDOWN logging * log everything from the retina::client::teardown module so the log level can be tweaked separately. * log when the session is expired. --- src/client/mod.rs | 1 - src/client/teardown.rs | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/mod.rs b/src/client/mod.rs index 5da11b1..7ba34a6 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -1752,7 +1752,6 @@ impl PinnedDrop for SessionInner { } }; - log::debug!("Starting background TEARDOWN for {}", &*session.id); handle.spawn(teardown::background_teardown( seqnum, this.presentation.base_url.clone(), diff --git a/src/client/teardown.rs b/src/client/teardown.rs index ba32309..ac36c0b 100644 --- a/src/client/teardown.rs +++ b/src/client/teardown.rs @@ -24,7 +24,8 @@ pub(super) async fn background_teardown( mut tx: tokio::sync::watch::Sender>>, expires: tokio::time::Instant, ) { - let _ = tokio::time::timeout_at( + log::debug!("TEARDOWN {} starting", &*session_id); + if tokio::time::timeout_at( expires, teardown_loop_forever( base_url, @@ -35,7 +36,11 @@ pub(super) async fn background_teardown( &mut tx, ), ) - .await; + .await + .is_err() + { + log::debug!("TEARDOWN {} aborted on session expiration", &*session_id); + } if let Some(ref session_group) = options.session_group { let seqnum = seqnum.expect("seqnum specified when session_group exists"); let mut l = session_group.0.lock().unwrap();