Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin: add an endpoint to dump spawned Tokio tasks #595

Merged
merged 32 commits into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
363a2fe
whoa it actually works now
hawkw Jul 13, 2020
94e91a5
make it look slightly less awful
hawkw Jul 13, 2020
b2db8c6
timings/fancy table
hawkw Jul 14, 2020
6577aa5
lol im good at html
hawkw Jul 14, 2020
1dd5599
lol im super good at html
hawkw Jul 14, 2020
4ae2063
whoopsie
hawkw Jul 14, 2020
f6bcab7
blaaahhhh
hawkw Jul 14, 2020
e590656
i'm *really* good at html
hawkw Jul 15, 2020
d060941
track total polls
hawkw Jul 15, 2020
3773642
json for @olix0r <3
hawkw Jul 15, 2020
ab9f68d
use pretty ctor
hawkw Jul 15, 2020
57f9f0b
fixup serde stuff
hawkw Jul 15, 2020
9607c6e
fixup
hawkw Jul 15, 2020
4557bdf
fixup tests
hawkw Jul 15, 2020
6eea722
include tasks layer in json mode too
hawkw Jul 15, 2020
f4f3b1b
require loopback to dump tasks
hawkw Jul 15, 2020
1aeb47b
fixup
hawkw Jul 15, 2020
e6e077b
fix panic in time-to-first-poll
hawkw Jul 15, 2020
5addbd4
pin unreleased crate to SHA
hawkw Jul 15, 2020
92750ed
disembreak test
hawkw Jul 15, 2020
b42615c
upstream perf fixes
hawkw Jul 15, 2020
519ce8c
use release version of Tokio!
hawkw Jul 23, 2020
0ebff79
rm patch
hawkw Jul 23, 2020
86db3c4
manual lockfile surgery
hawkw Jul 23, 2020
32051a4
whoopsy
hawkw Jul 23, 2020
3f404bb
maybe hit filters less for task tracking
hawkw Jul 24, 2020
84296a4
also handle disabling ansi correctly
hawkw Jul 24, 2020
d02213b
apparently i managed to screw up toml syntax somehow
hawkw Jul 24, 2020
e3a3fc0
put back selfs
hawkw Jul 28, 2020
f2be0b0
Merge branch 'main' into eliza/tokio-trace
hawkw Jul 30, 2020
bd0bbe7
fixup
hawkw Jul 30, 2020
7dad10d
Merge branch 'main' into eliza/tokio-trace
hawkw Jul 31, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 71 additions & 37 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ dependencies = [

[[package]]
name = "aho-corasick"
version = "0.6.4"
version = "0.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
dependencies = [
"memchr 2.3.3",
]
Expand Down Expand Up @@ -515,6 +515,15 @@ dependencies = [
"unicode-segmentation",
]

[[package]]
name = "hermit-abi"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9"
dependencies = [
"libc",
]

[[package]]
name = "hex"
version = "0.3.2"
Expand All @@ -532,6 +541,15 @@ dependencies = [
"winapi 0.3.8",
]

[[package]]
name = "html-escape"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c185ca7c57375b4d21eb5a1343a152099b9ea3e7e776971fce80f8d907a7ffb"
dependencies = [
"utf8-width",
]

[[package]]
name = "http"
version = "0.1.21"
Expand Down Expand Up @@ -743,6 +761,7 @@ dependencies = [
"bytes 0.5.4",
"futures 0.3.5",
"h2 0.2.6",
"html-escape",
"http 0.2.1",
"http-body",
"hyper",
Expand All @@ -758,7 +777,7 @@ dependencies = [
"linkerd2-proxy-api",
"net2",
"quickcheck",
"regex 1.0.0",
"regex 1.2.1",
"ring",
"rustls",
"tokio",
Expand All @@ -780,6 +799,7 @@ dependencies = [
"async-trait",
"bytes 0.5.4",
"futures 0.3.5",
"html-escape",
"http 0.2.1",
"http-body",
"hyper",
Expand Down Expand Up @@ -829,10 +849,12 @@ dependencies = [
"prost-types",
"quickcheck",
"rand 0.7.2",
"regex 1.0.0",
"regex 1.2.1",
"serde_json",
"tokio",
"tokio-test",
"tokio-timer",
"tokio-trace",
"tonic",
"tower",
"tower-request-modifier",
Expand Down Expand Up @@ -1443,7 +1465,7 @@ dependencies = [
"prost-types",
"quickcheck",
"rand 0.7.2",
"regex 1.0.0",
"regex 1.2.1",
"tokio",
"tonic",
"tower",
Expand Down Expand Up @@ -1717,6 +1739,16 @@ version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"

[[package]]
name = "num_cpus"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [
"hermit-abi",
"libc",
]

[[package]]
name = "object"
version = "0.19.0"
Expand Down Expand Up @@ -2132,15 +2164,14 @@ dependencies = [

[[package]]
name = "regex"
version = "1.0.0"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3"
checksum = "88c3d9193984285d544df4a30c23a4e62ead42edf70a4452ceb76dac1ce05c26"
dependencies = [
"aho-corasick 0.6.4",
"aho-corasick 0.7.13",
"memchr 2.3.3",
"regex-syntax 0.6.11",
"thread_local 0.3.5",
"utf8-ranges 1.0.0",
"thread_local 0.3.6",
]

[[package]]
Expand Down Expand Up @@ -2434,12 +2465,11 @@ dependencies = [

[[package]]
name = "thread_local"
version = "0.3.5"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
dependencies = [
"lazy_static",
"unreachable",
]

[[package]]
Expand All @@ -2455,9 +2485,9 @@ dependencies = [

[[package]]
name = "tokio"
version = "0.2.21"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58"
checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
dependencies = [
"bytes 0.5.4",
"fnv",
Expand All @@ -2473,6 +2503,7 @@ dependencies = [
"signal-hook-registry",
"slab",
"tokio-macros",
"tracing",
"winapi 0.3.8",
]

Expand Down Expand Up @@ -2562,6 +2593,18 @@ dependencies = [
"tokio-executor",
]

[[package]]
name = "tokio-trace"
version = "0.1.0"
source = "git+https://github.com/hawkw/tokio-trace?rev=a8240c5cbb4ff981def84920d4087ef23b5edb93#a8240c5cbb4ff981def84920d4087ef23b5edb93"
dependencies = [
"num_cpus",
"serde",
"tokio",
"tracing-core",
"tracing-subscriber",
]

[[package]]
name = "tokio-util"
version = "0.3.1"
Expand Down Expand Up @@ -2682,9 +2725,9 @@ dependencies = [

[[package]]
name = "tracing"
version = "0.1.15"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41f40ed0e162c911ac6fcb53ecdc8134c46905fdbbae8c50add462a538b495f"
checksum = "c2e2a2de6b0d5cbb13fc21193a2296888eaab62b6044479aafb3c54c01c29fcd"
dependencies = [
"cfg-if",
"log",
Expand All @@ -2694,9 +2737,9 @@ dependencies = [

[[package]]
name = "tracing-attributes"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99bbad0de3fd923c9c3232ead88510b783e5a4d16a6154adffa3d53308de984c"
checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b"
dependencies = [
"proc-macro2 1.0.10",
"quote 1.0.2",
Expand All @@ -2705,9 +2748,9 @@ dependencies = [

[[package]]
name = "tracing-core"
version = "0.1.10"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0aa83a9a47081cd522c09c81b31aec2c9273424976f922ad61c053b58350b715"
checksum = "94ae75f0d28ae10786f3b1895c55fe72e79928fd5ccdebb5438c75e93fec178f"
dependencies = [
"lazy_static",
]
Expand Down Expand Up @@ -2754,7 +2797,7 @@ dependencies = [
"lazy_static",
"matchers",
"parking_lot",
"regex 1.0.0",
"regex 1.2.1",
"serde",
"serde_json",
"sharded-slab",
Expand Down Expand Up @@ -2843,15 +2886,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"

[[package]]
name = "unreachable"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
dependencies = [
"void",
]

[[package]]
name = "untrusted"
version = "0.7.0"
Expand Down Expand Up @@ -2882,16 +2916,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"

[[package]]
name = "version_check"
version = "0.1.5"
name = "utf8-width"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
checksum = "6f2c54fe5e8d6907c60dc6fba532cc8529245d97ff4e26cb490cb462de114ba4"

[[package]]
name = "void"
version = "1.0.2"
name = "version_check"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"

[[package]]
name = "want"
Expand Down
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ ARG PROXY_UNOPTIMIZED
ARG PROXY_FEATURES

RUN --mount=type=cache,target=/var/lib/apt/lists \
--mount=type=cache,target=/var/tmp \
apt update && apt install -y time cmake
--mount=type=cache,target=/var/tmp \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto formatting here? Not a blocker but just wondering if this was intentional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, i think this change can be removed entirely — this was left over from an attempt at feature-flagging.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, would prefer to revert this as it removes some indentation below

apt update && apt install -y time cmake

WORKDIR /usr/src/linkerd2-proxy
COPY . .
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.44.1-buster,source=/usr/local/cargo,target=/usr/local/cargo \
mkdir -p /out && \
if [ -n "$PROXY_UNOPTIMIZED" ]; then \
(cd linkerd2-proxy && /usr/bin/time -v cargo build --locked --features="$PROXY_FEATURES") && \
mv target/debug/linkerd2-proxy /out/linkerd2-proxy ; \
else \
(cd linkerd2-proxy && /usr/bin/time -v cargo build --locked --release --features="$PROXY_FEATURES") && \
mv target/release/linkerd2-proxy /out/linkerd2-proxy ; \
fi
--mount=type=cache,from=rust:1.44.1-buster,source=/usr/local/cargo,target=/usr/local/cargo \
mkdir -p /out && \
if [ -n "$PROXY_UNOPTIMIZED" ]; then \
(cd linkerd2-proxy && /usr/bin/time -v cargo build --locked --features="$PROXY_FEATURES") && \
mv target/debug/linkerd2-proxy /out/linkerd2-proxy ; \
else \
(cd linkerd2-proxy && /usr/bin/time -v cargo build --locked --release --features="$PROXY_FEATURES") && \
mv target/release/linkerd2-proxy /out/linkerd2-proxy ; \
fi

## Install the proxy binary into the base runtime image.
FROM $RUNTIME_IMAGE as runtime
Expand Down
1 change: 1 addition & 0 deletions linkerd/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tonic = { version = "0.2", default-features = false, features = ["prost"] }
tower = "0.3"
tracing = "0.1.9"
tracing-futures = { version = "0.2", features = ["std-future"]}
html-escape = "0.2.5"

[dev-dependencies]
bytes = "0.5"
Expand Down
7 changes: 6 additions & 1 deletion linkerd/app/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ linkerd2-stack-tracing = { path = "../../stack/tracing" }
linkerd2-trace-context = { path = "../../trace-context" }
rand = { version = "0.7", features = ["small_rng"] }
regex = "1.0.0"
tokio = { version = "0.2", features = ["macros", "sync", "parking_lot"]}
tokio = { version = "0.2.22", features = ["macros", "sync", "parking_lot"]}
tokio-timer = "0.2"
tower-request-modifier = { git = "https://github.com/tower-rs/tower-http" }
tonic = { version = "0.2", default-features = false, features = ["prost"] }
Expand All @@ -72,6 +72,11 @@ tracing-futures = { version = "0.2", features = ["std-future"] }
tracing-log = "0.1"
pin-project = "0.4"

# task tracking
html-escape = "0.2.5"
tokio-trace = { git = "https://github.com/hawkw/tokio-trace", rev = "a8240c5cbb4ff981def84920d4087ef23b5edb93", features = ["serde"] }
serde_json = "1"

[dependencies.tracing-subscriber]
version = "0.2.8"
# we don't need `chrono` time formatting
Expand Down
Loading