Skip to content

Commit 39220d3

Browse files
committed
fix: fix client leaked pipes (#2474)
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
1 parent 121a4a4 commit 39220d3

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ version = "1.44.0"
2121
features = ["full","tracing"]
2222

2323
[workspace.dependencies.nix]
24-
version = "0.27"
24+
version = "0.30"
2525
default-features = false
2626
features = ["fs","user","signal"]
2727

packages/common/logs/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{os::fd::AsRawFd, path::PathBuf};
1+
use std::{os::fd::AsFd, path::PathBuf};
22

33
use anyhow::*;
44
use chrono::{Datelike, Duration, TimeDelta, TimeZone, Utc};
@@ -80,10 +80,10 @@ impl Logs {
8080
.append(true)
8181
.open(path)
8282
.await?;
83-
let log_fd = log_file.as_raw_fd();
83+
let log_fd = log_file.as_fd();
8484

85-
nix::unistd::dup2(log_fd, nix::libc::STDOUT_FILENO)?;
86-
nix::unistd::dup2(log_fd, nix::libc::STDERR_FILENO)?;
85+
nix::unistd::dup2_stdout(log_fd)?;
86+
nix::unistd::dup2_stderr(log_fd)?;
8787

8888
self.prune().await
8989
}
@@ -164,10 +164,10 @@ impl Logs {
164164
.create(true)
165165
.append(true)
166166
.open(path)?;
167-
let log_fd = log_file.as_raw_fd();
167+
let log_fd = log_file.as_fd();
168168

169-
nix::unistd::dup2(log_fd, nix::libc::STDOUT_FILENO)?;
170-
nix::unistd::dup2(log_fd, nix::libc::STDERR_FILENO)?;
169+
nix::unistd::dup2_stdout(log_fd)?;
170+
nix::unistd::dup2_stderr(log_fd)?;
171171

172172
self.prune_sync()
173173
}

packages/edge/infra/client/manager/src/runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl Handle {
185185
// Prepare the arguments for the runner
186186
let runner_args = vec![working_path.to_str().context("bad path")?];
187187

188-
// TODO: Do pipes have to be manually deleted here?
188+
// NOTE: Pipes are automatically closed on drop
189189
// Pipe communication between processes
190190
let (pipe_read, pipe_write) = pipe()?;
191191

packages/edge/services/pegboard/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ fdb-util = { workspace = true, optional = true }
1818
foundationdb = { workspace = true, optional = true }
1919
heck = "0.3"
2020
lazy_static = "1.4"
21-
nix = { version = "0.27", default-features = false, features = ["user", "signal"], optional = true }
21+
nix = { workspace = true, optional = true }
2222
rand = "0.8"
23+
regex = "1.10.3"
2324
reqwest = { version = "0.12", features = ["json"] }
2425
rivet-api.workspace = true
2526
rivet-config.workspace = true
@@ -35,7 +36,6 @@ serde_urlencoded = "0.7.0"
3536
strum = { version = "0.24", features = ["derive"] }
3637
thiserror = "1.0"
3738
uuid = "1.11.0"
38-
regex = "1.10.3"
3939

4040
build.workspace = true
4141
cluster.workspace = true

packages/toolchain/cli/Cargo.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@ path = "src/main.rs"
1414
# sentry = []
1515

1616
[dependencies]
17-
clap = { version = "4.5.9", features = ["derive"] }
18-
toolchain = { path = "../toolchain", package = "rivet-toolchain" }
19-
tokio.workspace = true
20-
serde = { version = "1.0", features = ["derive"] }
21-
serde_json = "1.0.120"
2217
anyhow = "1.0"
23-
uuid = { version = "1.11.0", features = ["v4"] }
24-
url = { version = "2.5.3", features = ["serde"] }
18+
async-posthog.workspace = true
2519
base64 = "0.22.1"
26-
kv-str.workspace = true
20+
clap = { version = "4.5.9", features = ["derive"] }
21+
ctrlc = "3.4.5"
22+
deno-embed.workspace = true
2723
inquire = "0.7.5"
28-
webbrowser = "1.0.2"
24+
kv-str.workspace = true
2925
# sentry = { version = "0.37.0", default-features = false, features = ["anyhow", "backtrace", "contexts", "debug-images", "panic", "reqwest", "rustls"] }
26+
serde = { version = "1.0", features = ["derive"] }
27+
serde_json = "1.0.120"
3028
sysinfo = "0.32.0"
31-
ctrlc = "3.4.5"
32-
async-posthog.workspace = true
33-
deno-embed.workspace = true
29+
tokio.workspace = true
30+
toolchain = { path = "../toolchain", package = "rivet-toolchain" }
31+
url = { version = "2.5.3", features = ["serde"] }
32+
uuid = { version = "1.11.0", features = ["v4"] }
33+
webbrowser = "1.0.2"
3434

3535
[target.'cfg(unix)'.dependencies]
36-
nix = { version = "0.27", default-features = false, features = ["user", "signal"] }
36+
nix.workspace = true
3737

3838
[build-dependencies]
3939
anyhow = "1.0"

0 commit comments

Comments
 (0)