From 1ab5df57e5b50a018737865346dcac756892168c Mon Sep 17 00:00:00 2001 From: danipiza Date: Mon, 30 Mar 2026 16:25:39 +0200 Subject: [PATCH 1/2] [#24316] Reduced InstanceCache key warning spam in Windows Signed-off-by: danipiza --- .../model/InstanceCache.hpp | 3 +++ .../src/cpp/model/InstanceCache.cpp | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/fastddsspy_participants/include/fastddsspy_participants/model/InstanceCache.hpp b/fastddsspy_participants/include/fastddsspy_participants/model/InstanceCache.hpp index 165ed705..2680b9ec 100644 --- a/fastddsspy_participants/include/fastddsspy_participants/model/InstanceCache.hpp +++ b/fastddsspy_participants/include/fastddsspy_participants/model/InstanceCache.hpp @@ -147,6 +147,9 @@ class InstanceCache // topic_name -> [key_field_names] std::map> key_fields_cache_; + + // Topics already warned because key metadata could not be discovered + std::set no_key_metadata_warned_topics_; }; } /* namespace participants */ diff --git a/fastddsspy_participants/src/cpp/model/InstanceCache.cpp b/fastddsspy_participants/src/cpp/model/InstanceCache.cpp index d7f0fe18..e283b0be 100644 --- a/fastddsspy_participants/src/cpp/model/InstanceCache.cpp +++ b/fastddsspy_participants/src/cpp/model/InstanceCache.cpp @@ -47,6 +47,18 @@ bool InstanceCache::add_or_update_instance( extract_key_field_names_(topic.m_topic_name, dyn_type); + auto key_fields_it = key_fields_cache_.find(topic.m_topic_name); + if (key_fields_it == key_fields_cache_.end() || key_fields_it->second.empty()) + { + if (no_key_metadata_warned_topics_.insert(topic.m_topic_name).second) + { + EPROSIMA_LOG_WARNING(FASTDDSSPY_INSTANCECACHE, + "No key metadata discovered for topic: " << topic.m_topic_name + << ". Skipping key instance caching."); + } + return false; + } + auto& topic_instances = instances_by_topic_[topic.m_topic_name]; auto instance_it = topic_instances.find(instance_handle); @@ -184,6 +196,7 @@ void InstanceCache::clear() noexcept std::unique_lock lock(mutex_); instances_by_topic_.clear(); key_fields_cache_.clear(); + no_key_metadata_warned_topics_.clear(); } // Private methods @@ -192,8 +205,9 @@ void InstanceCache::extract_key_field_names_( const std::string& topic_name, const fastdds::dds::DynamicType::_ref_type& dyn_type) noexcept { - // Already cached? - if (key_fields_cache_.find(topic_name) != key_fields_cache_.end()) + // Recompute only if key metadata has not been discovered yet + auto cached_keys_it = key_fields_cache_.find(topic_name); + if (cached_keys_it != key_fields_cache_.end() && !cached_keys_it->second.empty()) { return; } From 0c503bb6d7b3a64e71af37e47ea084243f53ea1c Mon Sep 17 00:00:00 2001 From: danipiza Date: Tue, 31 Mar 2026 07:28:05 +0200 Subject: [PATCH 2/2] Fixed windows documentation. 'vcs' command for powershell Signed-off-by: danipiza --- docs/rst/developer_manual/installation/sources/windows.rst | 2 +- .../rst/developer_manual/installation/sources/windows_cmake.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rst/developer_manual/installation/sources/windows.rst b/docs/rst/developer_manual/installation/sources/windows.rst index acb95232..7a779ed7 100644 --- a/docs/rst/developer_manual/installation/sources/windows.rst +++ b/docs/rst/developer_manual/installation/sources/windows.rst @@ -201,7 +201,7 @@ Colcon installation (recommended) cd \Fast-DDS-Spy mkdir src wget https://raw.githubusercontent.com/eProsima/Fast-DDS-Spy/main/fastddsspy.repos - vcs import src < fastddsspy.repos + vcs import src --input fastddsspy.repos .. note:: diff --git a/docs/rst/developer_manual/installation/sources/windows_cmake.rst b/docs/rst/developer_manual/installation/sources/windows_cmake.rst index 3f3880d7..e31a48e6 100644 --- a/docs/rst/developer_manual/installation/sources/windows_cmake.rst +++ b/docs/rst/developer_manual/installation/sources/windows_cmake.rst @@ -24,7 +24,7 @@ Local installation mkdir \fastdds-spy\build cd \fastdds-spy wget https://raw.githubusercontent.com/eProsima/Fast-DDS-Spy/main/fastddsspy.repos - vcs import src < fastddsspy.repos + vcs import src --input fastddsspy.repos #. Compile all dependencies using CMake_.