Skip to content

Commit d64085b

Browse files
moonlifacebook-github-bot
authored andcommitted
add comment to better understand heartbeating implementation (#785)
Summary: Pull Request resolved: #785 as the title Reviewed By: thomasywang Differential Revision: D79757211 fbshipit-source-id: 118f5bec8319debdc0a809fa648646aae3761049
1 parent ea2f50e commit d64085b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hyperactor_mesh/src/alloc/remoteprocess.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ impl RemoteProcessAllocator {
233233

234234
ensure_previous_alloc_stopped(&mut active_allocation).await;
235235
}
236+
// Hearbeat message is discarded immediately after being received, sender (client)
237+
// relies on channel ack to know if the receiver (remote process allocator) is
238+
// still alive. No state needs to be updated.
236239
Ok(RemoteProcessAllocatorMessage::HeartBeat) => {}
237240
Err(e) => {
238241
tracing::error!("upstream channel error: {}", e);
@@ -996,6 +999,9 @@ impl Alloc for RemoteProcessAlloc {
996999
break None;
9971000
}
9981001
}
1002+
// Hearbeat message is discarded immediately after being received, sender (remote
1003+
// process allocator) relies on channel ack to know if the receiver (client) is
1004+
// still alive. No state needs to be updated.
9991005
Ok(RemoteProcessProcStateMessage::HeartBeat) => {}
10001006
Err(e) => {
10011007
break Some(ProcState::Failed {world_id: self.world_id.clone(), description: format!("error receiving events: {}", e)});

0 commit comments

Comments
 (0)