diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index db86b34b..2e564bda 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -33,7 +33,7 @@ jobs: if: ${{ matrix.BUILD_TYPE == 'source' }} - name: Install Coverage Tools if: ${{ matrix.BUILD_TYPE == 'binary' }} - run: sudo apt update && sudo apt install -y python3-colcon-coveragepy-result python3-colcon-lcov-result lcov + run: sudo apt update && sudo apt upgrade -y && sudo apt install -y python3-colcon-coveragepy-result python3-colcon-lcov-result lcov - name: Build and run tests id: action-ros-ci uses: ros-tooling/action-ros-ci@v0.3 diff --git a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 index 270a3418..f100eff6 100644 --- a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 +++ b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_ROUTER_CONFIG.json5 @@ -498,8 +498,8 @@ connect_certificate: null, // Whether or not to verify the matching between hostname/dns and certificate when connecting, // if set to false zenoh will disregard the common names of the certificates when verifying servers. - // This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com. If you wan't your - // ca to verify that the server at baz.com is actually baz.com, let this be true (default). + // This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com. + // If you want your ca to verify that the server at baz.com is actually baz.com, let this be true (default). verify_name_on_connect: true, // Whether or not to close links when remote certificates expires. // If set to true, links that require certificates (tls/quic) will automatically disconnect when the time of expiration of the remote certificate chain is reached diff --git a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 index 839fa855..eea7c67d 100644 --- a/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 +++ b/rmw_zenoh_cpp/config/DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5 @@ -501,8 +501,8 @@ connect_certificate: null, // Whether or not to verify the matching between hostname/dns and certificate when connecting, // if set to false zenoh will disregard the common names of the certificates when verifying servers. - // This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com. If you wan't your - // ca to verify that the server at baz.com is actually baz.com, let this be true (default). + // This could be dangerous because your CA can have signed a server cert for foo.com, that's later being used to host a server at baz.com. + // If you want your ca to verify that the server at baz.com is actually baz.com, let this be true (default). verify_name_on_connect: true, // Whether or not to close links when remote certificates expires. // If set to true, links that require certificates (tls/quic) will automatically disconnect when the time of expiration of the remote certificate chain is reached diff --git a/rmw_zenoh_cpp/src/detail/graph_cache.cpp b/rmw_zenoh_cpp/src/detail/graph_cache.cpp index 6b2f9388..abadd967 100644 --- a/rmw_zenoh_cpp/src/detail/graph_cache.cpp +++ b/rmw_zenoh_cpp/src/detail/graph_cache.cpp @@ -356,7 +356,7 @@ void GraphCache::parse_put( range.first, range.second, [entity](const std::pair & node_it) { - // Match nodes if their zenoh sesion and node ids match. + // Match nodes if their zenoh session and node ids match. return entity->zid() == node_it.second->zid_ && entity->nid() == node_it.second->nid_; }); if (node_it == range.second) { @@ -573,7 +573,7 @@ void GraphCache::parse_del( range.first, range.second, [entity](const std::pair & node_it) { - // Match nodes if their zenoh sesion and node ids match. + // Match nodes if their zenoh session and node ids match. return entity->zid() == node_it.second->zid_ && entity->nid() == node_it.second->nid_; }); if (node_it == range.second) { diff --git a/rmw_zenoh_cpp/src/detail/graph_cache.hpp b/rmw_zenoh_cpp/src/detail/graph_cache.hpp index 0ec37153..22fffe20 100644 --- a/rmw_zenoh_cpp/src/detail/graph_cache.hpp +++ b/rmw_zenoh_cpp/src/detail/graph_cache.hpp @@ -91,7 +91,7 @@ struct GraphNode TopicMap pubs_ = {}; TopicMap subs_ = {}; - // Entires for service/client. + // Entries for service/client. TopicMap clients_ = {}; TopicMap services_ = {}; }; diff --git a/rmw_zenoh_cpp/src/detail/liveliness_utils.hpp b/rmw_zenoh_cpp/src/detail/liveliness_utils.hpp index 81880df6..8577619f 100644 --- a/rmw_zenoh_cpp/src/detail/liveliness_utils.hpp +++ b/rmw_zenoh_cpp/src/detail/liveliness_utils.hpp @@ -65,7 +65,7 @@ struct TopicInfo }; ///============================================================================= -/// Retuns the keyexpr for liveliness subscription. +/// Returns the keyexpr for liveliness subscription. std::string subscription_token(size_t domain_id); ///============================================================================= @@ -96,7 +96,7 @@ enum class EntityType : uint8_t * - The ROS namespace for this entity. If the namespace is absolute, this function will add in an _ for later parsing reasons. * - The ROS node name for this entity. * - * For entities with topic infomation, the liveliness token keyexpr have additional fields: + * For entities with topic information, the liveliness token keyexpr have additional fields: * * ////////// * - The ROS topic name for this entity. diff --git a/rmw_zenoh_cpp/src/detail/ordered_hash.hpp b/rmw_zenoh_cpp/src/detail/ordered_hash.hpp index 9411b5e1..c091c29e 100644 --- a/rmw_zenoh_cpp/src/detail/ordered_hash.hpp +++ b/rmw_zenoh_cpp/src/detail/ordered_hash.hpp @@ -1457,7 +1457,7 @@ class ordered_hash : private Hash, private KeyEqual { #endif /* - * The insertion didn't happend at the end of the m_values container, + * The insertion didn't happened at the end of the m_values container, * we need to shift the indexes in m_buckets_data. */ if (index_insert_position != m_values.size() - 1) { @@ -1661,7 +1661,7 @@ class ordered_hash : private Hash, private KeyEqual { static constexpr float REHASH_ON_HIGH_NB_PROBES__MIN_LOAD_FACTOR = 0.15f; /** - * Protocol version currenlty used for serialization. + * Protocol version currently used for serialization. */ static const slz_size_type SERIALIZATION_PROTOCOL_VERSION = 1; diff --git a/rmw_zenoh_cpp/src/detail/rmw_wait_set_data.hpp b/rmw_zenoh_cpp/src/detail/rmw_wait_set_data.hpp index c2594e6f..f502db68 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_wait_set_data.hpp +++ b/rmw_zenoh_cpp/src/detail/rmw_wait_set_data.hpp @@ -29,7 +29,7 @@ struct rmw_wait_set_data_t // there isn't a race in rmw_wait(). That could happen because of the following sequence: // // 1. Without taking a lock, rmw_wait() checks if any of the entities in the wait_set are ready, - // and if not attachs the condition_variable to it. + // and if not attaches the condition_variable to it. // 2. It then takes the lock, and sleeps on the condition_variable. // // However, doing step 1 takes time, and checks in a particular order: guard_conditions, events, diff --git a/rmw_zenoh_cpp/src/detail/zenoh_config.hpp b/rmw_zenoh_cpp/src/detail/zenoh_config.hpp index 1f1e194f..958ce1e7 100644 --- a/rmw_zenoh_cpp/src/detail/zenoh_config.hpp +++ b/rmw_zenoh_cpp/src/detail/zenoh_config.hpp @@ -57,7 +57,7 @@ std::optional get_z_config(const ConfigurableEntity & entity); /// @details The behavior is as follows: /// - If not set or 0, the max value is returned. /// - If less than 0, std::nullopt is returned. -/// - Else value of environemnt variable is returned. +/// - Else value of environment variable is returned. /// @return The number of times to try connecting to a zenoh router and /// std::nullopt if establishing a connection to a router is not required. std::optional zenoh_router_check_attempts(); diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index e7342c13..eb0ec924 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -395,6 +395,10 @@ rmw_create_publisher( context_impl, "unable to get rmw_context_impl_s", return nullptr); + if (context_impl->is_shutdown()) { + RMW_SET_ERROR_MSG("context_impl is shutdown"); + return nullptr; + } if (!context_impl->session_is_valid()) { RMW_SET_ERROR_MSG("zenoh session is invalid"); return nullptr; @@ -936,6 +940,10 @@ rmw_create_subscription( context_impl, "unable to get rmw_context_impl_s", return nullptr); + if (context_impl->is_shutdown()) { + RMW_SET_ERROR_MSG("context_impl is shutdown"); + return nullptr; + } if (!context_impl->session_is_valid()) { RMW_SET_ERROR_MSG("zenoh session is invalid"); return nullptr; @@ -1233,12 +1241,12 @@ rmw_take_sequence( } if (count > message_sequence->capacity) { - RMW_SET_ERROR_MSG("Insuffient capacity in message_sequence"); + RMW_SET_ERROR_MSG("Insufficient capacity in message_sequence"); return RMW_RET_INVALID_ARGUMENT; } if (count > message_info_sequence->capacity) { - RMW_SET_ERROR_MSG("Insuffient capacity in message_info_sequence"); + RMW_SET_ERROR_MSG("Insufficient capacity in message_info_sequence"); return RMW_RET_INVALID_ARGUMENT; } @@ -1439,6 +1447,10 @@ rmw_create_client( context_impl, "unable to get rmw_context_impl_s", return nullptr); + if (context_impl->is_shutdown()) { + RMW_SET_ERROR_MSG("context_impl is shutdown"); + return nullptr; + } if (!context_impl->session_is_valid()) { RMW_SET_ERROR_MSG("zenoh session is invalid"); return nullptr; @@ -1701,6 +1713,10 @@ rmw_create_service( context_impl, "unable to get rmw_context_impl_s", return nullptr); + if (context_impl->is_shutdown()) { + RMW_SET_ERROR_MSG("context_impl is shutdown"); + return nullptr; + } if (!context_impl->session_is_valid()) { RMW_SET_ERROR_MSG("zenoh session is invalid"); return nullptr; @@ -2581,7 +2597,7 @@ rmw_service_server_is_available( static_cast(client->data); if (client_data == nullptr) { RMW_SET_ERROR_MSG_WITH_FORMAT_STRING( - "Unable to retreive client_data from client for service %s", client->service_name); + "Unable to retrieve client_data from client for service %s", client->service_name); return RMW_RET_INVALID_ARGUMENT; } diff --git a/zenoh_cpp_vendor/CMakeLists.txt b/zenoh_cpp_vendor/CMakeLists.txt index 2d3ae046..57c45fbb 100644 --- a/zenoh_cpp_vendor/CMakeLists.txt +++ b/zenoh_cpp_vendor/CMakeLists.txt @@ -17,9 +17,12 @@ find_package(ament_cmake_vendor_package REQUIRED) # when expanded. set(ZENOHC_CARGO_FLAGS "--no-default-features$--features=shared-memory zenoh/transport_compression zenoh/transport_tcp zenoh/transport_tls") +# Set VCS_VERSION to include latest changes from zenoh/zenoh-c to benefit from : +# - https://github.com/eclipse-zenoh/zenoh/pull/1685 (Fix deadlock in advanced subscription undeclaration) +# - https://github.com/eclipse-zenoh/zenoh/pull/1696 (Fix SHM Garbage Collection (GC) policy) ament_vendor(zenoh_c_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git - VCS_VERSION 57d5e4d31d9b38fef34d7bcad3d3e54869c4ce73 + VCS_VERSION 61d8fcc136ce4ed36d921a32244da4f3d81a6097 CMAKE_ARGS "-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}" "-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE" @@ -28,11 +31,12 @@ ament_vendor(zenoh_c_vendor ament_export_dependencies(zenohc) -# Set VCS_VERSION to include latest changes from zenoh-c to benefit from : +# Set VCS_VERSION to include latest changes from zenoh-cpp to benefit from : # - https://github.com/eclipse-zenoh/zenoh-cpp/pull/342 (Fix include what you use) +# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/363 (Fix memory leak in string deserialization) ament_vendor(zenoh_cpp_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-cpp - VCS_VERSION 964b64dc8b935a43147287199e7bb12da7b141e6 + VCS_VERSION 05942637c29d3346ad18bab5a178aeebf4be5d62 CMAKE_ARGS -DZENOHCXX_ZENOHC=OFF )