From c47314b12daa2026a3d69d3073befe5cb110a64d Mon Sep 17 00:00:00 2001 From: Tim Zhang Date: Mon, 23 Oct 2023 18:48:02 +0800 Subject: [PATCH] sync-server: Ignore close fd error We can't avoid file descriptors being mistakenly closed by other code. So in this case, the only thing we can do is ignore errors. Signed-off-by: Tim Zhang --- src/sync/server.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/sync/server.rs b/src/sync/server.rs index 8f94bcf..7eebab7 100644 --- a/src/sync/server.rs +++ b/src/sync/server.rs @@ -346,7 +346,14 @@ impl Server { .map(|mut cn| { cn.handler.take().map(|handler| { handler.join().unwrap(); - close(fd).unwrap(); + close(fd) + .map_err(|e| { + warn!( + "close connection fd: {} failed: {:?}", + fd, e + ); + }) + .ok(); }) }); }