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

dropping session created with zenoh::init makes other sessions with the same runime unusable [Bug] #612

Closed
milyin opened this issue Dec 5, 2023 · 1 comment · Fixed by #917
Assignees
Labels
bug Something isn't working

Comments

@milyin
Copy link
Contributor

milyin commented Dec 5, 2023

Describe the bug

When two instances of session is created from the same runtime and then one of instances is dropped, the other one becomes unable to connect

To reproduce

Use this PR: #611
Run test with

cargo test zenoh_session_runtime_init --test session -- --nocapture

Result is

[  ][01a] Creating peer01 session runtime: ["tcp/127.0.1:17447"]
[  ][02a] Creating peer02 session runtime: ["tcp/127.0.1:17447"]
[RI][02a] Creating peer01 session from runtime 1
[RI][02b] Creating peer02 session from runtime 2
[RI][02c] Creating peer01a session from runtime 1
[PS][01b] Subscribing on peer01 session
[PS][02b] Putting on peer02 session. 1000 msgs of 1024 bytes.
[PS][03b] Received 553/1000.
[PS][03b] Received 1000/1000.
[PS][03b] Unsubscribing on peer01 session
[PS][01b] Subscribing on peer01 session
[PS][02b] Putting on peer02 session. 1000 msgs of 100000 bytes.
[PS][03b] Received 907/1000.
[PS][03b] Received 1000/1000.
[PS][03b] Unsubscribing on peer01 session
[RI][02d] Closing peer02a session
[PS][01b] Subscribing on peer01 session
[PS][02b] Putting on peer02 session. 1000 msgs of 1024 bytes.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.
[PS][03b] Received 0/1000.

If drop of second session is commented out (line https://github.com/eclipse-zenoh/zenoh/pull/611/files#diff-535d5571c1b372d9e23a72ae9944449c512e46aa82eea002eb0ef0681b66562fR252), result is ok:

[  ][01a] Creating peer01 session runtime: ["tcp/127.0.1:17447"]
[  ][02a] Creating peer02 session runtime: ["tcp/127.0.1:17447"]
[RI][02a] Creating peer01 session from runtime 1
[RI][02b] Creating peer02 session from runtime 2
[RI][02c] Creating peer01a session from runtime 1
[PS][01b] Subscribing on peer01 session
[PS][02b] Putting on peer02 session. 1000 msgs of 1024 bytes.
[PS][03b] Received 646/1000.
[PS][03b] Received 1000/1000.
[PS][03b] Unsubscribing on peer01 session
[PS][01b] Subscribing on peer01 session
[PS][02b] Putting on peer02 session. 1000 msgs of 100000 bytes.
[PS][03b] Received 915/1000.
[PS][03b] Received 1000/1000.
[PS][03b] Unsubscribing on peer01 session
[RI][02d] Closing peer02a session
[PS][01b] Subscribing on peer01 session
[PS][02b] Putting on peer02 session. 1000 msgs of 1024 bytes.
[PS][03b] Received 607/1000.
[PS][03b] Received 1000/1000.
[PS][03b] Unsubscribing on peer01 session
[PS][01b] Subscribing on peer01 session
[PS][02b] Putting on peer02 session. 1000 msgs of 100000 bytes.
[PS][03b] Received 912/1000.
[PS][03b] Received 1000/1000.
[PS][03b] Unsubscribing on peer01 session
test zenoh_session_runtime_init ... ok

System info

Ubuntu 22.02
Mac M2

@milyin milyin added the bug Something isn't working label Dec 5, 2023
@DenisBiryukov91
Copy link
Contributor

Proper fix for memory leaks (#695 ) would likely also address this issue.

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

Successfully merging a pull request may close this issue.

2 participants