Skip to content

Commit e74e09d

Browse files
committed
comments
1 parent 5301dd6 commit e74e09d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

trust-quorum/protocol/src/node.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,16 @@ impl Node {
381381
}
382382

383383
/// A peer node has disconnected from this one
384+
///
385+
/// Note: It is safe if a call to `on_disconnect` is missed due to a new
386+
/// connection replacing the existing connection and resulting in a call
387+
/// to `on_connect` while the node thinks it still maintains a connection.
388+
///
389+
/// All active behavior such as retries occur in `on_connect`. If the
390+
/// contents of this method change such that it is no longer safe to call
391+
/// `on_connect` without first calling `on_disconnect` for an already
392+
/// connected peer, then we can call `on_disconnect` first from directly
393+
/// within `on_connect`. For now that is unnecessary.
384394
pub fn on_disconnect(
385395
&mut self,
386396
ctx: &mut impl NodeHandlerCtx,

trust-quorum/src/connection_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub enum MainToConnMsg {
6262
/// `Node::on_disconnect`.
6363
///
6464
/// By always returning the `task_id`, we allow cleanup of proxy requests for
65-
/// stale nodes that will never complete.
65+
/// stale connections that will never complete.
6666
pub struct DisconnectedPeer {
6767
pub task_id: task::Id,
6868
pub peer_id: Option<BaseboardId>,

0 commit comments

Comments
 (0)