Skip to content

dropping TorClient will burn cpu

Summary

Dropping TorClient will stuck in tor_rtcompat::scheduler::TaskSchedule::sleep_until_wallclock() and burning cpu

Steps to reproduce:

Change the example of read.rs as following


/// readme.rs
#[tokio::main]
async fn main() -> Result<()> { 
    old_main().await?;
    println!("sleep forever");
    tokio::time::sleep(std::time::Duration::from_secs(999999)).await; // burning cpu here
    Ok(())
}

async fn old_main() -> Result<()> {
    ...
}

What is the current bug behavior?

What is the expected behavior?

Environment

Possible fixes: