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

rosrust publisher blocks when a single subscriber hangs #211

Open
jobafr opened this issue Jan 8, 2025 · 0 comments
Open

rosrust publisher blocks when a single subscriber hangs #211

jobafr opened this issue Jan 8, 2025 · 0 comments

Comments

@jobafr
Copy link

jobafr commented Jan 8, 2025

Expected behavior

  • When a subscriber becomes unresponsive, the Publisher should still send messages to the other subscribers. That would be consistent with the behavior of roscpp.

Actual behavior

  • All subscribers stop receiving messages when one of them hangs.

Minimum example for a rust publisher:

rosrust::rosmsg_include!( std_msgs/String );
use std_msgs::String;

fn main() {
    rosrust::init("spammer");
    let publisher = rosrust::publish("/chatter", 10).unwrap();
    let mut counter = 0;
    while rosrust::is_ok() {
        publisher.send(String { data: format!("Large amounts of data, culminating in this incrementing counter: {}", counter) }).unwrap();
        counter += 1;
        rosrust::sleep(rosrust::Duration::from_nanos(1_000_000));
    }
}

Then, open two more shells and run rostopic echo /chatter in both. Press Ctrl+Z in the second one to halt it. After a while (~30s on my machine), the other rostopic echo /chatter will stop receiving messages as well. Run fg in the shell where you did Ctrl+Z before. The messages now resume in both, with the first one skipping over the messages that were "lost" while the other was blocked.

What should happen instead

  • Only the hanging subscriber should skip messages. The other one should be receiving all messages with no interruption. That would be consistent with roscpp (you can check this behavior by running rosbag play on a bagfile and two rostopic echo clients, as in the example above).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant