Skip to content

Commit 68a64ac

Browse files
committed
chore: trace log from every task wakeup
1 parent d09a0ce commit 68a64ac

File tree

7 files changed

+11
-4
lines changed

7 files changed

+11
-4
lines changed

crates/rostra-client/src/task/followee_checker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl FolloweeChecker {
6565

6666
}
6767
}
68+
trace!(target: LOG_TARGET, "Woke up");
6869

6970
// Query only new followees
7071
for (followee_id, _persona_id) in &self_followees {

crates/rostra-client/src/task/followee_head_checker.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rostra_util_error::{BoxedErrorResult, FmtCompact, WhateverResult};
1212
use rostra_util_fmt::AsFmtOption as _;
1313
use snafu::ResultExt as _;
1414
use tokio::sync::watch;
15-
use tracing::{debug, info, instrument};
15+
use tracing::{debug, info, instrument, trace};
1616

1717
use crate::client::Client;
1818
use crate::ClientRef;
@@ -64,6 +64,7 @@ impl FolloweeHeadChecker {
6464
}
6565
}
6666
}
67+
trace!(target: LOG_TARGET, "Woke up");
6768

6869
let Ok(storage) = self.client.db() else {
6970
break;

crates/rostra-client/src/task/head_merger.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rostra_core::event::{EventKind, VerifiedEvent};
55
use rostra_core::id::{RostraId, RostraIdSecretKey};
66
use rostra_core::{Event, ShortEventId};
77
use tokio::sync::watch;
8-
use tracing::{debug, instrument};
8+
use tracing::{debug, instrument, trace};
99

1010
use crate::client::Client;
1111
const LOG_TARGET: &str = "rostra::head_merger";
@@ -33,6 +33,7 @@ impl HeadMerger {
3333
pub async fn run(self) {
3434
let mut head_rx = self.self_head_rx.clone();
3535
while let Ok(_head) = head_rx.changed().await {
36+
trace!(target: LOG_TARGET, "Woke up" );
3637
// To avoid two active nodes merging heads together at the same time, producing
3738
// more heads, that require more merging, etc., we just sleep a random period of
3839
// time here, which should be enough to propagate and eventually desynchronize.

crates/rostra-client/src/task/head_update_broadcaster.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rostra_p2p::connection::{Connection, FeedEventRequest};
99
use rostra_util_error::{FmtCompact, WhateverResult};
1010
use snafu::ResultExt as _;
1111
use tokio::sync::watch;
12-
use tracing::{debug, instrument, warn};
12+
use tracing::{debug, instrument, trace, warn};
1313

1414
use crate::client::Client;
1515
use crate::ClientRef;
@@ -54,6 +54,7 @@ impl HeadUpdateBroadcaster {
5454
}
5555
}
5656
}
57+
trace!(target: LOG_TARGET, "Woke up");
5758

5859
let Some(head) = *self_head_rx.borrow() else {
5960
warn!(target: LOG_TARGET, "Empty head!?");

crates/rostra-client/src/task/missing_event_fetcher.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rostra_core::ShortEventId;
66
use rostra_p2p::Connection;
77
use rostra_util_error::{BoxedErrorResult, FmtCompact, WhateverResult};
88
use snafu::ResultExt as _;
9-
use tracing::{debug, instrument, warn};
9+
use tracing::{debug, instrument, trace, warn};
1010

1111
use crate::client::Client;
1212
use crate::{ClientHandle, LOG_TARGET};
@@ -43,6 +43,7 @@ impl MissingEventFetcher {
4343
continue;
4444
}
4545
};
46+
trace!(target: LOG_TARGET, "Woke up");
4647

4748
let Ok(db) = self.client.db() else {
4849
break;

crates/rostra-client/src/task/pkarr_id_publisher.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ impl PkarrIdPublisher {
9797
}
9898
}
9999
}
100+
trace!(target: LOG_TARGET, "Woke up");
100101

101102
self.wait_for_your_turn().await;
102103
debug!(target: LOG_TARGET, "Detect no other peer alive, assuming the role of Pkarr ID publisher");

crates/rostra-client/src/task/request_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ impl RequestHandler {
9797
return;
9898
};
9999

100+
trace!(target: LOG_TARGET, "New connection" );
100101
tokio::spawn(self.clone().handle_incoming(incoming));
101102
}
102103
}

0 commit comments

Comments
 (0)