-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
When using HORUS pub/sub across two different files, each running its own scheduler, the subscriber node crashes when publishing/subscribing Image messages.
The exact same nodes work correctly when both publisher and subscriber are run in the same binary with a single scheduler.
Steps to Reproduce
- Create a publisher node that publishes an Image message on a topic.
- Create a subscriber node that subscribes to the same topic.
- Compile and run each node as a separate binary, each with its own Scheduler.
- Observe that the subscriber crashes at runtime.
- Run both nodes in the same binary and scheduler → the image is received correctly.
Expected Behavior
Image pub/sub works across schedulers/processes. If an error happens, a runtime error should be raised.
Actual Behavior
Process [node] exited with code: -1
HORUS Version
0.1.7
Operating System
Ubuntu 24.04
Rust Version
rustc 1.92.0
Language
Rust
Minimal Code Example
test.rs
use horus::prelude::*;
node! {
TestSendNode {
name: "test_send_node",
rate 1.0
pub {
test_pub: Image -> "test_send.image"
}
tick(ctx) {
let width = 324;
let height = 244;
let pixels = vec![0u8; width * height * 3]; // Empty image
let image = Image::new(width as u32, height as u32, ImageEncoding::Rgb8, pixels);
let _ = self.test_pub.send(image, &mut ctx);
}
}
}
fn main() -> Result<()> {
let mut scheduler = Scheduler::new().name("test_scheduler");
scheduler.add(Box::new(TestSendNode::new()), 1, Some(true));
// Run the scheduler loop - continuously ticks all nodes
let _ = scheduler.run();
Ok(())
}test_receive.rs
use horus::prelude::*;
node! {
TestReceiveNode {
name: "test_receive_node",
rate 5.0
sub {
test_sub: Image -> "test_send.image"
}
tick(ctx) {
if let Some(image) = self.test_sub.recv(&mut ctx) {
if image.is_valid() {
println!("Received image");
}
}
}
}
}
fn main() -> Result<()> {
let mut scheduler = Scheduler::new().name("test_receive_scheduler");
scheduler.add(Box::new(TestReceiveNode::new()), 1, Some(true));
// Run the scheduler loop - continuously ticks all nodes
let _ = scheduler.run();
Ok(())
}Relevant Logs
Process [test_receive] exited with code: -1
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working