Skip to content

Commit

Permalink
fix: Remove tokio console subscriber (#1524)
Browse files Browse the repository at this point in the history
The console subscriber is the source of quite a few papercuts like
#1513.

Since we don't use it at the moment, I decided to remove it.
  • Loading branch information
mre authored Oct 12, 2024
1 parent 060e0cd commit e2814ac
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 226 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
185 changes: 0 additions & 185 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 0 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
13 changes: 1 addition & 12 deletions lychee-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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"
3 changes: 0 additions & 3 deletions lychee-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2814ac

Please sign in to comment.