fix: Remove tokio console subscriber (#1524)

The console subscriber is the source of quite a few papercuts like
https://github.com/lycheeverse/lychee/issues/1513.

Since we don't use it at the moment, I decided to remove it.
This commit is contained in:
Matthias Endler 2024-10-12 02:19:31 +02:00 committed by GitHub
parent 060e0cd55c
commit e2814acaa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 2 additions and 226 deletions

View file

@ -15,8 +15,7 @@ on:
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
# tokio_unstable is needed for tokio-console
RUSTFLAGS: -D warnings --cfg tokio_unstable
RUSTFLAGS: -D warnings
jobs:
test:

185
Cargo.lock generated
View file

@ -483,53 +483,6 @@ dependencies = [
"paste",
]
[[package]]
name = "axum"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf"
dependencies = [
"async-trait",
"axum-core",
"bytes",
"futures-util",
"http 1.1.0",
"http-body 1.0.0",
"http-body-util",
"itoa",
"matchit",
"memchr",
"mime",
"percent-encoding",
"pin-project-lite",
"rustversion",
"serde",
"sync_wrapper 1.0.1",
"tower 0.4.13",
"tower-layer",
"tower-service",
]
[[package]]
name = "axum-core"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3"
dependencies = [
"async-trait",
"bytes",
"futures-util",
"http 1.1.0",
"http-body 1.0.0",
"http-body-util",
"mime",
"pin-project-lite",
"rustversion",
"sync_wrapper 0.1.2",
"tower-layer",
"tower-service",
]
[[package]]
name = "backtrace"
version = "0.3.71"
@ -677,12 +630,6 @@ version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
version = "1.6.0"
@ -939,45 +886,6 @@ dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "console-api"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86ed14aa9c9f927213c6e4f3ef75faaad3406134efe84ba2cb7983431d5f0931"
dependencies = [
"futures-core",
"prost",
"prost-types",
"tonic",
"tracing-core",
]
[[package]]
name = "console-subscriber"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e3a111a37f3333946ebf9da370ba5c5577b18eb342ec683eb488dd21980302"
dependencies = [
"console-api",
"crossbeam-channel",
"crossbeam-utils",
"futures-task",
"hdrhistogram",
"humantime",
"hyper-util",
"prost",
"prost-types",
"serde",
"serde_json",
"thread_local",
"tokio",
"tokio-stream",
"tonic",
"tracing",
"tracing-core",
"tracing-subscriber",
]
[[package]]
name = "const_format"
version = "0.2.33"
@ -1945,19 +1853,6 @@ dependencies = [
"allocator-api2",
]
[[package]]
name = "hdrhistogram"
version = "7.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d"
dependencies = [
"base64 0.21.7",
"byteorder",
"flate2",
"nom",
"num-traits",
]
[[package]]
name = "headers"
version = "0.4.0"
@ -2612,7 +2507,6 @@ dependencies = [
"assert_cmd",
"clap",
"console",
"console-subscriber",
"const_format",
"csv",
"dashmap 6.1.0",
@ -2748,12 +2642,6 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
[[package]]
name = "matchit"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
[[package]]
name = "md5"
version = "0.7.0"
@ -3402,38 +3290,6 @@ dependencies = [
"unicode-ident",
]
[[package]]
name = "prost"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc"
dependencies = [
"bytes",
"prost-derive",
]
[[package]]
name = "prost-derive"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca"
dependencies = [
"anyhow",
"itertools",
"proc-macro2",
"quote",
"syn 2.0.79",
]
[[package]]
name = "prost-types"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2"
dependencies = [
"prost",
]
[[package]]
name = "psl-types"
version = "2.0.11"
@ -4601,7 +4457,6 @@ dependencies = [
"signal-hook-registry",
"socket2 0.5.6",
"tokio-macros",
"tracing",
"windows-sys 0.52.0",
]
@ -4708,36 +4563,6 @@ dependencies = [
"winnow",
]
[[package]]
name = "tonic"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401"
dependencies = [
"async-stream",
"async-trait",
"axum",
"base64 0.22.0",
"bytes",
"h2 0.4.4",
"http 1.1.0",
"http-body 1.0.0",
"http-body-util",
"hyper 1.4.1",
"hyper-timeout",
"hyper-util",
"percent-encoding",
"pin-project",
"prost",
"socket2 0.5.6",
"tokio",
"tokio-stream",
"tower 0.4.13",
"tower-layer",
"tower-service",
"tracing",
]
[[package]]
name = "tower"
version = "0.4.13"
@ -4746,11 +4571,8 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
"indexmap 1.9.3",
"pin-project",
"pin-project-lite",
"rand",
"slab",
"tokio",
"tokio-util",
"tower-layer",
@ -4833,7 +4655,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
dependencies = [
"once_cell",
"valuable",
]
[[package]]
@ -5008,12 +4829,6 @@ dependencies = [
"getrandom",
]
[[package]]
name = "valuable"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "value-bag"
version = "1.8.1"

View file

@ -663,30 +663,6 @@ Try one of these links to get started:
For more detailed instructions, head over to [`CONTRIBUTING.md`](/CONTRIBUTING.md).
## Debugging and improving async code
Lychee makes heavy use of async code to be resource-friendly while still being
performant. Async code can be difficult to troubleshoot with most tools,
however. Therefore we provide experimental support for
[tokio-console](https://github.com/tokio-rs/console). It provides a top(1)-like
overview for async tasks!
If you want to give it a spin, download and start the console:
```sh
git clone https://github.com/tokio-rs/console
cd console
cargo run
```
Then run lychee with some special flags and features enabled.
```sh
RUSTFLAGS="--cfg tokio_unstable" cargo run --features tokio-console -- <input1> <input2> ...
```
If you find a way to make lychee faster, please do reach out.
## Troubleshooting and Workarounds
We collect a list of common workarounds for various websites in our [troubleshooting guide](./docs/TROUBLESHOOTING.md).

View file

@ -68,18 +68,7 @@ tracing-subscriber = { version = "0.3.18", default-features = false, features =
uuid = { version = "1.10.0", features = ["v4"] }
wiremock = "0.6.2"
[dependencies.console-subscriber]
version = "0.4.0"
optional = true
[dependencies.tracing-subscriber]
version = "0.3.18"
default-features = false
features = ["fmt", "env-filter"]
optional = true
[features]
tokio-console = ["dep:console-subscriber", "dep:tracing-subscriber"]
# Compile and statically link a copy of OpenSSL.
vendored-openssl = ["openssl-sys/vendored"]
@ -110,4 +99,4 @@ required-features = ["check_example_domains"]
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ archive-suffix }"
bin-dir = "{ bin }{ binary-ext }"
pkg-fmt = "tgz"
pkg-fmt = "tgz"

View file

@ -115,9 +115,6 @@ enum ExitCode {
const LYCHEEIGNORE_COMMENT_MARKER: &str = "#";
fn main() -> Result<()> {
#[cfg(feature = "tokio-console")]
console_subscriber::init();
// std::process::exit doesn't guarantee that all destructors will be run,
// therefore we wrap the main code in another function to ensure that.
// See: https://doc.rust-lang.org/stable/std/process/fn.exit.html