Skip to content

Commit 519420e

Browse files
authored
Update tower-balance (#392)
tower-balance has been refactored and updated to use a new version of the `rand` crate. This change udpates the project to use the latest tower-balance, rand, and quickcheck dependencies I've soak-tested this over the weekend and the new balancer implementation is at least as good as the prior version in terms of latency and CPU usage.
1 parent 2aec731 commit 519420e

File tree

19 files changed

+208
-103
lines changed

19 files changed

+208
-103
lines changed

Cargo.lock

Lines changed: 164 additions & 63 deletions
Large diffs are not rendered by default.

linkerd/app/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ http = "0.1"
3131
http-body = "0.1"
3232
hyper = "0.12"
3333
linkerd2-metrics = { path = "../metrics", features = ["test_util"] }
34-
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", features = ["arbitrary"], tag = "v0.1.10" }
34+
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", features = ["arbitrary"], tag = "v0.1.11" }
3535
net2 = "0.2"
36-
quickcheck = { version = "0.8", default-features = false }
36+
quickcheck = { version = "0.9", default-features = false }
3737
ring = "0.16"
3838
rustls = "0.16"
3939
tokio-connect = { git = "https://github.com/carllerche/tokio-connect" }

linkerd/app/core/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ linkerd2-fallback = { path = "../../fallback" }
2828
linkerd2-metrics = { path = "../../metrics" }
2929
linkerd2-opencensus = { path = "../../opencensus" }
3030
linkerd2-proxy-core = { path = "../../proxy/core" }
31-
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", tag = "v0.1.10" }
31+
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", tag = "v0.1.11" }
3232
linkerd2-proxy-api-resolve = { path = "../../proxy/api-resolve" }
3333
linkerd2-proxy-detect = { path = "../../proxy/detect" }
3434
linkerd2-proxy-discover = { path = "../../proxy/discover" }
@@ -44,7 +44,7 @@ linkerd2-router = { path = "../../router" }
4444
linkerd2-stack = { path = "../../stack" }
4545
linkerd2-timeout = { path = "../../timeout" }
4646
linkerd2-trace-context = { path = "../../trace-context" }
47-
rand = "0.6"
47+
rand = { version = "0.7", features = ["small_rng"] }
4848
regex = "1.0.0"
4949
tokio = "0.1.14"
5050
tokio-timer = "0.2"
@@ -70,6 +70,6 @@ procinfo = "0.4.2"
7070

7171
[dev-dependencies]
7272
linkerd2-test-util = { path = "../../test-util" }
73-
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", features = ["arbitrary"], tag = "v0.1.10" }
73+
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", features = ["arbitrary"], tag = "v0.1.11" }
7474
prost-types = "0.5.0"
75-
quickcheck = { version = "0.8", default-features = false }
75+
quickcheck = { version = "0.9", default-features = false }

linkerd/app/core/src/trace.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@ const ENV_LOG: &str = "LINKERD2_PROXY_LOG";
33
use linkerd2_error::Error;
44
use std::{env, fmt, str, time::Instant};
55
use tokio_timer::clock;
6-
pub use tracing::{debug, error, info, warn};
76
use tracing::{Dispatch, Event, Level};
87
use tracing_subscriber::{
98
filter,
109
fmt::{format, Builder, Context, Formatter},
10+
reload, EnvFilter, FmtSubscriber,
1111
};
12-
use tracing_subscriber::{reload, EnvFilter, FmtSubscriber};
1312

1413
type SubscriberBuilder = Builder<format::NewRecorder, Format, filter::LevelFilter>;
1514
type Subscriber = Formatter<format::NewRecorder, Format>;
@@ -119,7 +118,7 @@ impl LevelHandle {
119118
let level = level.as_ref();
120119
let filter = level.parse::<EnvFilter>()?;
121120
self.inner.reload(filter)?;
122-
info!(message = "set new log level", %level);
121+
tracing::info!(%level, "set new log level");
123122
Ok(())
124123
}
125124

linkerd/app/inbound/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ tower-grpc = { version = "0.1", default-features = false, features = ["protobuf"
2020
tracing = "0.1.9"
2121

2222
[dev-dependencies]
23-
quickcheck = { version = "0.8", default-features = false }
23+
quickcheck = { version = "0.9", default-features = false }

linkerd/app/integration/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ linkerd2-app = { path = ".." }
2626
linkerd2-app-core = { path = "../core" }
2727
linkerd2-metrics = { path = "../../metrics", features = ["test_util"] }
2828
linkerd2-test-util = { path = "../../test-util" }
29-
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", features = ["arbitrary"], tag = "v0.1.10" }
29+
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", features = ["arbitrary"], tag = "v0.1.11" }
3030
regex = "0.1"
3131
net2 = "0.2"
32-
quickcheck = { version = "0.8", default-features = false }
32+
quickcheck = { version = "0.9", default-features = false }
3333
ring = "0.16"
3434
rustls = "0.16"
3535
tokio = "0.1.14"

linkerd/app/outbound/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ tower-grpc = { version = "0.1", default-features = false, features = ["protobuf"
2020
tracing = "0.1.9"
2121

2222
[dev-dependencies]
23-
quickcheck = { version = "0.8", default-features = false }
23+
quickcheck = { version = "0.9", default-features = false }

linkerd/exp-backoff/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ publish = false
88

99
[dependencies]
1010
futures = "0.1"
11-
rand = "0.6.3"
11+
rand = { version = "0.7", features = ["small_rng"] }
1212
tokio-timer = "0.2.6"
1313

1414
[dev-dependencies]
15-
quickcheck = { version = "0.8", default-features = false }
15+
quickcheck = { version = "0.9", default-features = false }

linkerd/exp-backoff/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![deny(warnings, rust_2018_idioms)]
22

33
use futures::{try_ready, Future, Poll, Stream};
4-
use rand::{rngs::SmallRng, FromEntropy};
4+
use rand::{rngs::SmallRng, SeedableRng};
55
use std::fmt;
66
use std::ops::Mul;
77
use std::time::Duration;

linkerd/metrics/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ indexmap = "1.0"
1818
tracing = "0.1.2"
1919

2020
[dev-dependencies]
21-
quickcheck = { version = "0.8", default-features = false }
21+
quickcheck = { version = "0.9", default-features = false }

0 commit comments

Comments
 (0)