Fix 500ms scouting delay regression introduced in 1.7.2#2493
Merged
OlivierHecart merged 2 commits intoeclipse-zenoh:mainfrom Mar 20, 2026
Merged
Fix 500ms scouting delay regression introduced in 1.7.2#2493OlivierHecart merged 2 commits intoeclipse-zenoh:mainfrom
OlivierHecart merged 2 commits intoeclipse-zenoh:mainfrom
Conversation
The gossip refactor in 39a4405 ("Fix bugs in gossip (eclipse-zenoh#2347)") introduced a 500ms delay in zenoh.open() by calling add_peer_connector_zid for already-connected peers, creating unterminated entries that block start_conditions.notified() for the full scouting delay.
add_peer_connector_zid was called unconditionally for all autoconnectable nodes in gossip link_states, including peers already connected via scouting. The spawned connect task short-circuits when the transport already exists, skipping terminate_peer_connector_zid. Entries without locators (such as the local node echoed back in gossip) never spawn a task at all. Both cases leave unterminated connectors that block start_conditions.notified() for the full 500ms scouting delay.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2493 +/- ##
==========================================
- Coverage 72.58% 72.50% -0.08%
==========================================
Files 390 390
Lines 63366 63358 -8
==========================================
- Hits 45992 45939 -53
- Misses 17374 17419 +45 ☔ View full report in Codecov by Sentry. |
OlivierHecart
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I was upgrading zenoh for a project I'm working on from 1.7.1 to 1.7.2 and noticed
zenoh.open()taking ~500ms longer. Traced it to the gossip refactor in #2347.What does this PR do?
Move
add_peer_connector_zidinside the spawned task, after the transport existence check.Why is this change needed?
Related Issues
Here is a python script for reproducing the issue
🏷️ 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:
Why this matters: Bugs without tests often reoccur.
Instructions:
- [ ]to- [x])This checklist updates automatically when labels change, but preserves your checked boxes.