Skip to content

Support multiple connections in the client mode.#2320

Merged
OlivierHecart merged 15 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:support_multiclient
May 20, 2026
Merged

Support multiple connections in the client mode.#2320
OlivierHecart merged 15 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:support_multiclient

Conversation

@evshary

@evshary evshary commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

Solve #2142

We added the EndPoints to accept a single EndPoint or EndPoint vector.

To test the multiple connections:

RUST_LOG=zenoh_transport::unicast::establishment=debug cargo run --bin zenohd -- --cfg=transport/unicast/max_links:2
RUST_LOG=zenoh_transport::unicast::establishment=debug cargo run --example z_sub -- --cfg=transport/unicast/max_links:2 --cfg="connect/endpoints:[{strategy:'allOf',locators:['tcp/127.0.0.1:7447?rel=0','tcp/127.0.0.1:7447?rel=1']}]" -m client

Note that only 'allOf' is implemented in the PR. We leave 'oneOf' for the future.


🏷️ Label-Based Checklist

Based on the labels applied to this PR, please complete these additional requirements:

Labels: bug

🐛 Bug Fix Requirements

Since this PR is labeled as a bug fix, please ensure:

  • Root cause documented - Explain what caused the bug in the PR description
  • Reproduction test added - Test that fails on main branch without the fix
  • Test passes with fix - The reproduction test passes with your changes
  • Regression prevention - Test will catch if this bug reoccurs in the future
  • Fix is minimal - Changes are focused only on fixing the bug
  • Related bugs checked - Verified no similar bugs exist in related code

Why this matters: Bugs without tests often reoccur.

Instructions:

  1. Check off items as you complete them (change - [ ] to - [x])
  2. The PR checklist CI will verify these are completed

This checklist updates automatically when labels change, but preserves your checked boxes.

Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@github-actions

Copy link
Copy Markdown

PR missing one of the required labels: {'dependencies', 'breaking-change', 'enhancement', 'api-sync', 'bug', 'internal', 'ci', 'new feature', 'documentation'}

@evshary evshary added the bug Something isn't working label Dec 17, 2025
@codecov

codecov Bot commented Dec 17, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.10471% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.01%. Comparing base (77507c1) to head (d4d7762).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
zenoh/src/net/runtime/orchestrator.rs 75.71% 17 Missing ⚠️
commons/zenoh-config/src/mode_dependent.rs 60.86% 9 Missing ⚠️
commons/zenoh-protocol/src/core/endpoint.rs 90.62% 6 Missing ⚠️
commons/zenoh-config/src/lib.rs 83.33% 5 Missing ⚠️
zenohd/src/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2320      +/-   ##
==========================================
- Coverage   74.01%   74.01%   -0.01%     
==========================================
  Files         400      400              
  Lines       60846    60991     +145     
==========================================
+ Hits        45034    45140     +106     
- Misses      15812    15851      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Comment thread examples/src/lib.rs Outdated
}

if !args.connect.is_empty() {
// Able to parse multiple endpoints, e.g. "tcp/127.0.0.1:7447?rel=0,tcp/127.0.0.1:7447?rel=1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change in behavior.
Coma separated values were already accepted here and were the equivalent of passing multiple -e arguments.
Let's decide if:

  • we assume this behavior change and add this in a minor release
  • find another separator for this case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer the first one, while the second one will make usage complicated.
However, it's still fine with me if we decide on the second one.

@OlivierHecart

Copy link
Copy Markdown
Contributor

I also realize that we had plans to create locator groups for peers, where peer connect to a single endpoint of each group. We need to decide if this is still something we consider and how to articulate that with the multilink thing here.

@OlivierHecart

Copy link
Copy Markdown
Contributor

Another point, I don't see any changes in DEFAULT_CONFIG.json5. It would be good to have this roughly documented there.

Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary

evshary commented Jan 6, 2026

Copy link
Copy Markdown
Contributor Author

Another point, I don't see any changes in DEFAULT_CONFIG.json5. It would be good to have this roughly documented there.

I thought it would make the description too complicated, so I just skipped that.
I've added it to the config now.

@OlivierHecart
OlivierHecart requested review from fuzzypixelz and removed request for fuzzypixelz January 6, 2026 09:52
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary
evshary force-pushed the support_multiclient branch from 7f4dc41 to 43854bc Compare January 14, 2026 07:47
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary
evshary requested a review from OlivierHecart January 15, 2026 08:20
@evshary
evshary force-pushed the support_multiclient branch 2 times, most recently from a70b060 to 589d911 Compare May 4, 2026 05:32
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary
evshary force-pushed the support_multiclient branch 2 times, most recently from 4de772f to 1b03d5a Compare May 4, 2026 07:50
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary
evshary force-pushed the support_multiclient branch from 1b03d5a to 2405e55 Compare May 4, 2026 07:58
@evshary

evshary commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@OlivierHecart I also added some tests for the feature.
I think the CI failure is related to the outdated tide in the rest plugin, which should be fixed here.
#2176

evshary added 2 commits May 13, 2026 20:06
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@OlivierHecart
OlivierHecart merged commit 12442bb into eclipse-zenoh:main May 20, 2026
28 checks passed
@OlivierHecart
OlivierHecart deleted the support_multiclient branch May 20, 2026 11:13
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 this pull request may close these issues.

2 participants