Skip to content

Commit

Permalink
Merge pull request #3182 from autonomys/timekeeper-inherit-service-span
Browse files Browse the repository at this point in the history
Inherit service span in PoT timekeeper thread
  • Loading branch information
nazar-pc authored Oct 28, 2024
2 parents f9f1bfc + 53ae99d commit 4208839
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/sc-proof-of-time/src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use subspace_core_primitives::pot::PotCheckpoints;
use subspace_core_primitives::PublicKey;
use thread_priority::{set_current_thread_priority, ThreadPriority};
use tokio::sync::broadcast;
use tracing::{debug, error, trace, warn};
use tracing::{debug, error, trace, warn, Span};

const LOCAL_PROOFS_CHANNEL_CAPACITY: usize = 10;
const SLOTS_CHANNEL_CAPACITY: usize = 10;
Expand Down Expand Up @@ -137,10 +137,13 @@ where
if is_timekeeper {
let state = Arc::clone(&state);
let pot_verifier = pot_verifier.clone();
let span = Span::current();

thread::Builder::new()
.name("timekeeper".to_string())
.spawn(move || {
let _guard = span.enter();

if let Some(core) = timekeeper_cpu_cores.into_iter().next() {
if !core_affinity::set_for_current(CoreId { id: core }) {
warn!(
Expand Down

0 comments on commit 4208839

Please sign in to comment.