Skip to content

Commit

Permalink
sync-server: Ignore close fd error
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Tim-Zhang committed Oct 23, 2023
1 parent 29560c8 commit c47314b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sync/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
})
});
}
Expand Down

0 comments on commit c47314b

Please sign in to comment.