Commit 7365f2fb authored by Peter Goodspeed-Niklaus's avatar Peter Goodspeed-Niklaus
Browse files

REVERT ME: more logging tracing job lifespans

parent 78b5e9a0
Pipeline #115177 canceled with stages
in 9 minutes and 3 seconds
......@@ -418,6 +418,7 @@ struct JobHandle<ToJob> {
impl<ToJob> JobHandle<ToJob> {
/// Send a message to the job.
async fn send_msg(&mut self, msg: ToJob) -> Result<(), Error> {
tracing::info!("JobHandle::send_msg");
self.to_job.send(msg).await.map_err(Into::into)
}
}
......@@ -622,15 +623,24 @@ impl<Spawner: SpawnNamed, Job: 'static + JobTrait> Jobs<Spawner, Job> {
/// Stop the job associated with this `parent_hash`.
pub async fn stop_job(&mut self, parent_hash: Hash) {
if Job::NAME == "CandidateBackingJob" {
tracing::info!(job = Job::NAME, relay_parent = ?parent_hash, "stop_job");
}
if let Some(handle) = self.running.remove(&parent_hash) {
handle.stop().await;
} else {
if Job::NAME == "CandidateBackingJob" {
tracing::info!(job = Job::NAME, relay_parent = ?parent_hash, "stop_job but job was already gone");
}
}
}
/// Send a message to the appropriate job for this `parent_hash`.
async fn send_msg(&mut self, parent_hash: Hash, msg: Job::ToJob) {
if let Entry::Occupied(mut job) = self.running.entry(parent_hash) {
tracing::info!(job = Job::NAME, relay_parent = ?parent_hash, "send_msg sending message");
if Job::NAME == "CandidateBackingJob" {
tracing::info!(job = Job::NAME, relay_parent = ?parent_hash, "send_msg sending message");
}
if job.get_mut().send_msg(msg).await.is_err() {
tracing::debug!(job = Job::NAME, "failed to send message to job, will remove it");
job.remove();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment