zenoh icon indicating copy to clipboard operation
zenoh copied to clipboard

Duplicated connections

Open fuzzypixelz opened this issue 1 year ago • 1 comments

Describe the bug

The Runtime obtains Endpoints through scouting and user configuration. It tries to connect to both kinds of Endpoints concurrently without coordination. This can lead to duplicated connections.

~~Moreover, more links are created to the same Transport session than transport/unicast/max_links.~~ transport/unicast/max_links only affects the number of incoming links.

Locators obtained through scouting usually can have IP addresses (even if the listener is configured with a domain name), but Endpoints supplied in configuration can use domain names (e.g. "localhost"), this mismatch is another cause for connection duplication.

To reproduce

⚠️ EDIT(5/8/25): The reproduction commands were incorrect, I meant to use the hostname in the peer and the IP address in zenohd, not the other way around.

  1. cargo run --bin zenohd -- --cfg 'transport/unicast/max_links:4' --cfg 'plugins_loading/enabled:false' -l 'tcp/127.0.0.1:9000' -l 'tcp/127.0.0.1:9001' --id a
  2. cargo run --example z_get -- -s '@/*/session/transport/unicast/a/link/*' -e 'tcp/localhost:9000' -e 'tcp/localhost:9001'

In my experiments, only one of the Endpoints is duplicated.

System info

  • ref: 36b97aa7

fuzzypixelz avatar Sep 11 '24 10:09 fuzzypixelz

@sashacmc I can still reproduce this as of 07f5d89526e5391b6199cd8de4fd886ae2776249.

fuzzypixelz avatar Aug 05 '25 15:08 fuzzypixelz