Skip to content

Commit

Permalink
add more instrumentation for sending status back to sc (#614)
Browse files Browse the repository at this point in the history
fix dispatche channel update by using replace instead of add
  • Loading branch information
sehz authored Dec 28, 2020
1 parent 8ce6b26 commit 81ae106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/spu/src/controllers/leader_replica/replica_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ where
}

pub async fn send_status_to_sc(&self, sc_sink: &SharedSinkMessageChannel) {
sc_sink.send(self.as_lrs_request()).await
let lrs = self.as_lrs_request();
debug!(hw = lrs.leader.hw, leo = lrs.leader.leo);
sc_sink.send(lrs).await
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/spu/src/controllers/sc/message_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl ScSinkMessageChannel {
/// newer entry will overwrite previous if it has not been cleared
pub async fn send(&self, request: LrsRequest) {
let mut lock = self.0.lock().await;
lock.insert(request);
lock.replace(request);
}

pub async fn remove_all(&self) -> Vec<LrsRequest> {
Expand Down

0 comments on commit 81ae106

Please sign in to comment.