Skip to content
Snippets Groups Projects
Commit fa3b5d16 authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov
Browse files

fix: avoid dropping msg_timeout_now

Since a recent commit, message destination (`to` field) is taken into
account. Make it correct to avoid skipping.
parent 169c02fe
No related branches found
No related tags found
1 merge request!158Refactor join loop (v2)
...@@ -153,6 +153,7 @@ pub struct Status { ...@@ -153,6 +153,7 @@ pub struct Status {
/// The heart of `traft` module - the Node. /// The heart of `traft` module - the Node.
#[derive(Debug)] #[derive(Debug)]
pub struct Node { pub struct Node {
raft_id: RaftId,
_main_loop: fiber::UnitJoinHandle<'static>, _main_loop: fiber::UnitJoinHandle<'static>,
_conf_change_loop: fiber::UnitJoinHandle<'static>, _conf_change_loop: fiber::UnitJoinHandle<'static>,
main_inbox: Mailbox<NormalRequest>, main_inbox: Mailbox<NormalRequest>,
...@@ -250,6 +251,7 @@ impl Node { ...@@ -250,6 +251,7 @@ impl Node {
}; };
let node = Node { let node = Node {
raft_id: cfg.id,
main_inbox, main_inbox,
status, status,
_main_loop: fiber::Builder::new() _main_loop: fiber::Builder::new()
...@@ -329,6 +331,8 @@ impl Node { ...@@ -329,6 +331,8 @@ impl Node {
pub fn timeout_now(&self) { pub fn timeout_now(&self) {
self.step(raft::Message { self.step(raft::Message {
to: self.raft_id,
from: self.raft_id,
msg_type: raft::MessageType::MsgTimeoutNow, msg_type: raft::MessageType::MsgTimeoutNow,
..Default::default() ..Default::default()
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment