Explorar el Código

Updates on stale comments.

Jing Yang hace 3 años
padre
commit
4e5d810997
Se han modificado 2 ficheros con 1 adiciones y 4 borrados
  1. 1 1
      src/election.rs
  2. 0 3
      src/sync_log_entries.rs

+ 1 - 1
src/election.rs

@@ -342,7 +342,7 @@ impl<Command: ReplicableCommand> Raft<Command> {
     const REQUEST_VOTE_RETRY: usize = 1;
     async fn request_vote(peer: Peer, args: RequestVoteArgs) -> Option<bool> {
         let term = args.term;
-        // See the comment in send_heartbeat() for this override.
+        // See the comment in send_heartbeat() on why a reference is used.
         let rpc_client = RemoteContext::<Command>::rpc_client(peer);
         let reply =
             retry_rpc(Self::REQUEST_VOTE_RETRY, RPC_DEADLINE, move |_round| {

+ 0 - 3
src/sync_log_entries.rs

@@ -329,7 +329,6 @@ impl<Command: ReplicableCommand> Raft<Command> {
                 // start and end, guaranteed by check_committed() above.
                 progress.record_success(committed.index + 1);
 
-                // Ignore the error. The log syncing thread must have died.
                 comms.rerun(peer);
             }
             Ok(SyncLogEntriesResult::Diverged(committed)) => {
@@ -351,7 +350,6 @@ impl<Command: ReplicableCommand> Raft<Command> {
 
                 progress.record_failure(committed.index);
 
-                // Ignore the error. The log syncing thread must have died.
                 comms.rerun(peer);
             }
             // Do nothing, not our term anymore.
@@ -360,7 +358,6 @@ impl<Command: ReplicableCommand> Raft<Command> {
             }
             Err(_) => {
                 tokio::time::sleep(HEARTBEAT_INTERVAL).await;
-                // Ignore the error. The log syncing thread must have died.
                 comms.rerun(peer);
             }
         };