zenoh icon indicating copy to clipboard operation
zenoh copied to clipboard

``PublicationCache is not dropped

Open YuanYuYuan opened this issue 9 months ago • 2 comments

Describe the bug

A new session creation hangs if a PublicationCache of another closed session is not dropped.

To reproduce

use config::ModeDependentValue;
use zenoh_ext::SessionExt;
use zenoh::prelude::r#async::*;

#[tokio::main]
async fn main() {
    {
        let mut config = config::peer();
        config
            .timestamping
            .set_enabled(Some(ModeDependentValue::Unique(true)))
            .unwrap();

        println!("Open a zenoh session.");
        let session = zenoh::open(config).res().await.unwrap();

        println!("Declare a publisher.");
        session.declare_publisher("asdfasdfas").res().await.unwrap();

        // Comment out this block can pass the test
        println!("Declare a publisher cache.");
        session
            .declare_publication_cache("asdfasdf")
            .res()
            .await
            .unwrap();

        println!("Drop the session.");
    }
    println!("Open a new zenoh session.");
    zenoh::open(config::peer()).res().await.unwrap();

    println!("Done.");
}

System info

YuanYuYuan avatar May 27 '24 10:05 YuanYuYuan