Skip to content

Commit 1c15dd0

Browse files
authored
chore(linkerd2-proxy): always enable multicore features (#3738)
The proxy predates the multi-threaded tokio runtime. When switching to it, we added a 'multicore' feature to adopt it incrementally. This has been the only supported configuration for many years now. This change removes the needless feature flag to simplify the runtime configuration.
1 parent a683ff5 commit 1c15dd0

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

linkerd2-proxy/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ publish = false
88
description = "The main proxy executable"
99

1010
[features]
11-
default = ["multicore", "meshtls-rustls"]
12-
multicore = ["tokio/rt-multi-thread", "num_cpus"]
11+
default = ["meshtls-rustls"]
1312
meshtls-boring = ["linkerd-meshtls/boring"]
1413
meshtls-boring-fips = ["linkerd-meshtls/boring-fips"]
1514
meshtls-rustls = ["linkerd-meshtls/rustls"]
@@ -25,8 +24,8 @@ linkerd-metrics = { path = "../linkerd/metrics" }
2524
# control its feature flags.
2625
linkerd-meshtls = { path = "../linkerd/meshtls" }
2726
linkerd-signal = { path = "../linkerd/signal" }
28-
num_cpus = { version = "1", optional = true }
29-
tokio = { version = "1", features = ["rt", "time", "net"] }
27+
num_cpus = "1"
28+
tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "net"] }
3029
tracing = "0.1"
3130

3231
[target.x86_64-unknown-linux-gnu.dependencies]

linkerd2-proxy/src/rt.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use tokio::runtime::{Builder, Runtime};
22
use tracing::{info, warn};
33

4-
#[cfg(feature = "multicore")]
54
pub(crate) fn build() -> Runtime {
65
// The proxy creates an additional admin thread, but it would be wasteful to
76
// allocate a whole core to it; so we let the main runtime consume all
@@ -55,16 +54,6 @@ pub(crate) fn build() -> Runtime {
5554
}
5655
}
5756

58-
#[cfg(not(feature = "multicore"))]
59-
pub(crate) fn build() -> Runtime {
60-
Builder::new()
61-
.enable_all()
62-
.thread_name("proxy")
63-
.basic_scheduler()
64-
.build()
65-
.expect("failed to build basic runtime!")
66-
}
67-
6857
/// Spawns a task to scrape metrics for the given runtime at a regular interval.
6958
///
7059
/// Note that this module requires unstable tokio functionality that must be

0 commit comments

Comments
 (0)