You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Tokio任务丢失Waker问题求助:原因及解决方案

任务丢失Waker问题求助

任务丢失Waker的警告截图

我遇到了大量任务丢失Waker的情况,但无法理解其原因及发生机制。

任务生成位置

loop {
    tokio::select! {
        // send final bundle
        Some(bundle) = bundle_receiver.recv() => {
            for client in &clients {
                tokio::spawn(
                    send_bundle(bundle.clone(), client.clone())
                );
            }
        },
     }
 }

对应函数

pub async fn send_bundle(
    bundle: BundleRequest,
    client: Arc<SignerMiddleware<FlashbotsMiddleware<Arc<Provider<Http>>, Wallet<SigningKey>>, Wallet<SigningKey>>>,
) {

    match client.inner().send_bundle(&bundle).await {
        Ok(info) => {
            
            debug!("\nBundle Hash: {:?}\nRelay: {:?}", info.bundle_hash, client.inner().relay());

        },
        Err(info) => {

            trace!("\nResponse: {:?}\nRelay: {:?}", info, client.inner().relay());
     
        }
    }
}

逻辑很简单,就是生成任务调用API接口。这对我来说是全新的概念,我没有解决思路,尝试添加.await、返回值等方法,但都无法消除该警告。


内容的提问来源于stack exchange,提问作者Arvin Morawej

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 03:14:59