From 0c2c652481df4898c739dbf1e6ce6e788625d5bd Mon Sep 17 00:00:00 2001 From: e-ngo Date: Thu, 23 Jan 2025 12:09:15 -0800 Subject: [PATCH] bug: Remove download server UDS file on client startup if UDS file already exists... --- dragonfly-client/src/grpc/dfdaemon_download.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dragonfly-client/src/grpc/dfdaemon_download.rs b/dragonfly-client/src/grpc/dfdaemon_download.rs index ef8e2f2f..ea60267d 100644 --- a/dragonfly-client/src/grpc/dfdaemon_download.rs +++ b/dragonfly-client/src/grpc/dfdaemon_download.rs @@ -127,6 +127,11 @@ impl DfdaemonDownloadServer { // Start download grpc server with unix domain socket. fs::create_dir_all(self.socket_path.parent().unwrap()).await?; + + if self.socket_path.is_file() { + // Remove the old unix domain socket file if it exists. + fs::remove_file(&self.socket_path).await?; + } let uds = UnixListener::bind(&self.socket_path)?; let uds_stream = UnixListenerStream::new(uds);