Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

``PublicationCache is not dropped #1054

Open
YuanYuYuan opened this issue May 27, 2024 · 2 comments
Open

``PublicationCache is not dropped #1054

YuanYuYuan opened this issue May 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@YuanYuYuan
Copy link
Contributor

YuanYuYuan commented May 27, 2024

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 YuanYuYuan added the bug Something isn't working label May 27, 2024
@YuanYuYuan
Copy link
Contributor Author

It seems that we need to replace the close function here with the Undeclare trait to align the undeclaration used in Queryable, Subscriber, etc.

@YuanYuYuan
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant