Skip to content

Race condition in downsampling rules with multiple matches #2200

@ciandonovan

Description

@ciandonovan

Describe the bug

  downsampling: [
    {
      messages: [ "push" ],
      rules: [
        { key_expr: "*/thermal_image/sensor_msgs::msg::dds_::Image_/*", freq: 10 },
        { key_expr: "**/sensor_msgs::msg::dds_::Image_/*", freq: 1 },
      ],
    },
  ],

I want to apply a general downsample to /sensor_msgs::msg::dds_::Image_, but to exclude the topic here thermal_image and apply a looser downsampling rule.

In either order of which rule is first, there is a race condition where sometimes the general rule is applied to thermal_image, but sometimes the specific rule is correctly applied.

I'd like to see the rules being applied deterministically, where it is documented behaviour that either the first or the last rule match applies.

To reproduce

Configure a local Zenoh router on the target machine with the above configuration snippet.

Use a bridging router to connect the target Zenoh router to your local machine, below is an out-of-the-box example.

podman run -it --init --pull=newer --tz=local --ipc=host --net=host --dns=127.0.0.53 --volume="/tmp/:/tmp/:rw" --env RUST_LOG=warn,zenoh_transport::unicast::establishment=debug docker.io/eclipse/zenoh:1.5.1 --cfg='listen/endpoints:[]' --cfg='connect/endpoints:["tcp/localhost:7447","tcp/192.168.1.10:7447"]' --cfg='scouting/multicast/enabled:false' --cfg='transport/shared_memory/enabled:true' --cfg='transport/unicast/max_links:3'

Restart the target Zenoh router a number of times, observe the local subscriber's frequency, watch it be sometimes 1 Hz sometimes 10 Hz for that session at random.

System info

  • Platform: Offical DockerHub ROS 2 Jazzy images
  • Zenoh version: 1.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions