Skip to content

Commit

Permalink
server: fix server exit once a accept failed
Browse files Browse the repository at this point in the history
If the Accept error occurs, an error can be output to ensure that the
subsequent connect can be accepted normally.

Fixes: containerd#239
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
  • Loading branch information
quanweiZhou authored and quanwei.zqw committed Sep 23, 2024
1 parent 1c185cb commit 0dfc98f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sync/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ impl Server {
Ok(fd) => fd,
Err(e) => {
error!("failed to accept error {:?}", e);
break;
continue;
}
};

Expand All @@ -439,13 +439,13 @@ impl Server {
Ok(fd) => {
if let Err(err) = set_fd_close_exec(fd) {
error!("fcntl failed after accept: {:?}", err);
break;
continue;
};
fd
}
Err(e) => {
error!("failed to accept error {:?}", e);
break;
continue;
}
};

Expand Down

0 comments on commit 0dfc98f

Please sign in to comment.