From 81f1292660e504e2fa1c1ced626ccc12c08a398d Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 11 Apr 2024 10:56:32 +0200 Subject: [PATCH] sync service: show the termination report debug info in the error logs We do see lots of "broken channel" log lines for these two log statements, and since I'm unclear why they happened, I'd like to add a bit more logging to those. Also makes the log level consistent, both are set to "warn" instead of one warn and one error. Usually it's not a big deal because the only error that may happen is that the channel is broken, indicating the task died before, so there's no need to stop it manually. --- crates/matrix-sdk-ui/src/sync_service.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/matrix-sdk-ui/src/sync_service.rs b/crates/matrix-sdk-ui/src/sync_service.rs index 25b36baa6..10515d22d 100644 --- a/crates/matrix-sdk-ui/src/sync_service.rs +++ b/crates/matrix-sdk-ui/src/sync_service.rs @@ -161,7 +161,7 @@ impl SyncService { if stop_room_list { if let Err(err) = room_list_service.stop_sync() { - error!("unable to stop room list service: {err:#}"); + warn!(?report, "unable to stop room list service: {err:#}"); } } @@ -176,7 +176,7 @@ impl SyncService { if stop_encryption { if let Err(err) = encryption_sync.stop_sync() { - warn!("unable to stop encryption sync: {err:#}"); + warn!(?report, "unable to stop encryption sync: {err:#}"); } } @@ -406,12 +406,14 @@ impl SyncService { } } +#[derive(Debug)] enum TerminationOrigin { EncryptionSync, RoomList, Scheduler, } +#[derive(Debug)] struct TerminationReport { is_error: bool, has_expired: bool,