Bladeren bron

Fix a deadlock at test shutdown.

The test thread holds the network lock for too long and blocks the
network thread. The network thread indirectly holds a reference to
the raft instance, causing the latter to block on kill(), which
blocks the test thread.

This is Github issue #1.
Jing Yang 5 jaren geleden
bovenliggende
commit
672f6bd38d
1 gewijzigde bestanden met toevoegingen van 1 en 0 verwijderingen
  1. 1 0
      tests/config/mod.rs

+ 1 - 0
tests/config/mod.rs

@@ -363,6 +363,7 @@ impl Config {
             network.remove_server(Self::server_name(i));
         }
         network.stop();
+        drop(network);
         for raft in &mut self.state.lock().rafts {
             if let Some(raft) = raft.take() {
                 raft.kill();