Skip to content

Commit f3471b6

Browse files
author
Hui Zhu
authored
Merge pull request containerd#70 from Tim-Zhang/fix-client-fd-leak
Fix fd leakage in client
2 parents 6a242e3 + 19516d2 commit f3471b6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ttrpc"
3-
version = "0.4.10"
3+
version = "0.4.11"
44
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
55
edition = "2018"
66
license = "Apache-2.0"

src/sync/client.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl Client {
5050
AddressFamily::Unix,
5151
SockType::Stream,
5252
None,
53-
SockFlag::empty(),
53+
SockFlag::SOCK_CLOEXEC,
5454
)
5555
.unwrap();
5656
let client_close = Arc::new(ClientClose { fd, close_fd });
@@ -185,6 +185,9 @@ impl Client {
185185

186186
map.remove(&mh.stream_id);
187187
}
188+
189+
close(recver_fd).unwrap();
190+
188191
trace!("Recver quit");
189192
});
190193

0 commit comments

Comments
 (0)