Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Fix bug when socket file is deleted
Alexis Sellier committed 3 years ago
commit b29ce1a22298449f7e838821ec7afbef6157ae81
parent 97f7064094d97ae694ce926d310cf7db6ec4a9e0
1 file changed +5 -3
modified radicle-node/src/runtime.rs
@@ -230,13 +230,15 @@ impl<G: Signer + EcSign + 'static> Runtime<G> {

        self.pool.run().unwrap();
        self.reactor.join().unwrap();
-
        control.join().unwrap()?;

        daemon::kill(&daemon).ok(); // Ignore error if daemon has already exited, for whatever reason.
        daemon.wait()?;

-
        fs::remove_file(home.socket()).ok();
-

+
        // If the socket file was deleted by some other process, for whatever reason,
+
        // the control thread will not be able to join.
+
        if fs::remove_file(home.socket()).is_ok() {
+
            control.join().unwrap()?;
+
        }
        log::debug!(target: "node", "Node shutdown completed for {}", self.id);

        Ok(())