-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/unregistration provider #1675
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 20 out of 27. Check the log or trigger a new build to see more.
|
||
if (IsProcessRegistration(unregister_sample)) | ||
{ | ||
auto& sample_process = sample_.process; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
if (IsTopicRegistration(unregister_sample)) | ||
{ | ||
auto& sample_topic = sample_.topic; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
if (unregister_sample.cmd_type == bct_unreg_service) | ||
{ | ||
auto& sample_service = sample_.service; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
if (unregister_sample.cmd_type == bct_unreg_client) | ||
{ | ||
auto& sample_client = sample_.client; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
}; | ||
|
||
// Transport layer parameters for ecal udp multicast | ||
struct LayerParUdpMC | ||
{ | ||
bool operator==(const LayerParUdpMC&) const |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
|
||
eCAL::Registration::Sample sub_foo_process_b_unregister; | ||
eCAL::Registration::Sample sub_foo_process_b_register_1; | ||
eCAL::Registration::Sample sub_foo_process_b_register_2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'sub_foo_process_b_register_2' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
eCAL::Registration::Sample sub_foo_process_b_register_2;
^
// make sure we create unique topic IDs for our testcases | ||
std::string getUniqueId() | ||
{ | ||
static int topic_id = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'topic_id' of type 'int' can be declared 'const' [misc-const-correctness]
static int topic_id = 1; | |
static int const topic_id = 1; |
eCAL::Registration::Sample UpdateTopicSample(const eCAL::Registration::Sample& input_) | ||
{ | ||
// vary statistical data | ||
eCAL::Registration::Sample updated = input_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'updated' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample updated = input_; | |
eCAL::Registration::Sample updated = 0 = input_; |
} | ||
|
||
private: | ||
static duration current_time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'current_time' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
static duration current_time;
^
}; | ||
|
||
// Initialize the static member | ||
TestingClock::duration TestingClock::current_time{ 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'current_time' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
TestingClock::duration TestingClock::current_time{ 0 };
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 20 out of 21. Check the log or trigger a new build to see more.
@@ -40,6 +40,13 @@ namespace | |||
return reg_sample; | |||
} | |||
|
|||
eCAL::Registration::Sample DestroyPublisher(const std::string& topic_name_, std::uint64_t topic_id_) | |||
{ | |||
eCAL::Registration::Sample reg_sample = CreatePublisher(topic_name_, topic_id_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'reg_sample' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample reg_sample = CreatePublisher(topic_name_, topic_id_); | |
eCAL::Registration::Sample reg_sample = 0 = CreatePublisher(topic_name_, topic_id_); |
@@ -52,6 +59,13 @@ | |||
return reg_sample; | |||
} | |||
|
|||
eCAL::Registration::Sample DestroySubscriber(const std::string& topic_name_, std::uint64_t topic_id_) | |||
{ | |||
eCAL::Registration::Sample reg_sample = CreateSubscriber(topic_name_, topic_id_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'reg_sample' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample reg_sample = CreateSubscriber(topic_name_, topic_id_); | |
eCAL::Registration::Sample reg_sample = 0 = CreateSubscriber(topic_name_, topic_id_); |
@@ -65,6 +79,13 @@ | |||
return reg_sample; | |||
} | |||
|
|||
eCAL::Registration::Sample DestroyService(const std::string& service_name_, std::uint64_t service_id_) | |||
{ | |||
eCAL::Registration::Sample reg_sample = CreateService(service_name_, service_id_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'reg_sample' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample reg_sample = CreateService(service_name_, service_id_); | |
eCAL::Registration::Sample reg_sample = 0 = CreateService(service_name_, service_id_); |
|
||
eCAL::Registration::Sample DestroyClient(const std::string& client_name_, std::uint64_t service_id_) | ||
{ | ||
eCAL::Registration::Sample reg_sample = CreateClient(client_name_, service_id_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'reg_sample' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample reg_sample = CreateClient(client_name_, service_id_); | |
eCAL::Registration::Sample reg_sample = 0 = CreateClient(client_name_, service_id_); |
} | ||
|
||
TEST(core_cpp_descgate, PublisherExpiration) | ||
{ | ||
eCAL::CDescGate desc_gate(std::chrono::milliseconds(DESCGATE_EXPIRATION_MS)); | ||
eCAL::CDescGate desc_gate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'desc_gate' is not initialized [cppcoreguidelines-init-variables]
eCAL::CDescGate desc_gate; | |
eCAL::CDescGate desc_gate = 0; |
} | ||
}; | ||
|
||
TEST_F(core_cpp_registration, IsUnregistrationSamples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: all parameters should be named in a function [readability-named-parameter]
TEST_F(core_cpp_registration, IsUnregistrationSamples) | |
TEST_F(core_cpp_registration /*unused*/, IsUnregistrationSamples /*unused*/) |
} | ||
|
||
|
||
TEST_F(core_cpp_registration, CreateUnregistrationSamples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: all parameters should be named in a function [readability-named-parameter]
TEST_F(core_cpp_registration, CreateUnregistrationSamples) | |
TEST_F(core_cpp_registration /*unused*/, CreateUnregistrationSamples /*unused*/) |
|
||
// we apply samples and then unregistration samples | ||
// we need to veryfy no callback is called | ||
TEST_F(core_cpp_registration, TimeOutProviderApplyUnregistration) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: all parameters should be named in a function [readability-named-parameter]
TEST_F(core_cpp_registration, TimeOutProviderApplyUnregistration) | |
TEST_F(core_cpp_registration /*unused*/, TimeOutProviderApplyUnregistration /*unused*/) |
// we need to veryfy no callback is called | ||
TEST_F(core_cpp_registration, TimeOutProviderApplyUnregistration) | ||
{ | ||
int callbacks_called = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'callbacks_called' of type 'int' can be declared 'const' [misc-const-correctness]
int callbacks_called = 0; | |
int const callbacks_called = 0; |
|
||
// we apply samples and then unregistration samples | ||
// we need to veryfy no callback is called | ||
TEST_F(core_cpp_registration, TimeOutProviderApplyTimeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: all parameters should be named in a function [readability-named-parameter]
TEST_F(core_cpp_registration, TimeOutProviderApplyTimeout) | |
TEST_F(core_cpp_registration /*unused*/, TimeOutProviderApplyTimeout /*unused*/) |
The client gate does not yet provide an Unregistration method. Hence it keeps the expiration map and needs to be considered at a later point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6c00c31
to
eaabbca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
TEST_F(core_cpp_registration, TimeOutProviderApplyTimeout) | ||
{ | ||
int callbacks_called = 0; | ||
eCAL::Registration::Sample sample_from_callback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'sample_from_callback' is not initialized [cppcoreguidelines-init-variables]
eCAL::Registration::Sample sample_from_callback; | |
eCAL::Registration::Sample sample_from_callback = 0; |
eaabbca
to
faddd23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
||
for (const auto& registration_sample : expired_samples) | ||
{ | ||
Sample unregistration_sample = CreateUnregisterSample(registration_sample.second); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'unregistration_sample' of type 'Sample' can be declared 'const' [misc-const-correctness]
Sample unregistration_sample = CreateUnregisterSample(registration_sample.second); | |
Sample const unregistration_sample = CreateUnregisterSample(registration_sample.second); |
}; | ||
|
||
// Transport layer parameters for ecal udp multicast | ||
struct LayerParUdpMC | ||
{ | ||
bool operator==(const LayerParUdpMC& other) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'other' is unused [misc-unused-parameters]
bool operator==(const LayerParUdpMC& other) const { | |
bool operator==(const LayerParUdpMC& /*other*/) const { |
// sleep | ||
TestingClock::increment_time(std::chrono::milliseconds(150)); | ||
} | ||
|
||
TEST(core_cpp_core, ExpMap_EraseMultiple) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: all parameters should be named in a function [readability-named-parameter]
TEST(core_cpp_core, ExpMap_EraseMultiple) | |
TEST(core_cpp_core /*unused*/, ExpMap_EraseMultiple /*unused*/) |
…ead of all over the place). Modifies also CExpirationMap interface to return keys and values of expired items.
faddd23
to
0832a1d
Compare
commit e13cadb Author: Peguen <[email protected]> Date: Fri Aug 23 14:30:08 2024 +0200 [config] Move host_group_name logic (eclipse-ecal#1720) * Removed HostName in registration config, added usage in attribute builder. ecal/tests/cpp/pubsub_proto_test/src/commit a410305 Author: KerstinKeller <[email protected]> Date: Fri Aug 23 14:27:54 2024 +0200 [core] Bugfix: Publishers / Subscribers need to use global configuration, when no configuration is provided. (eclipse-ecal#1721) commit 4f8bad0 Author: Peguen <[email protected]> Date: Thu Aug 22 12:56:37 2024 +0200 [config] Removed quoteStrings and unused variable in config test. (eclipse-ecal#1718) commit bfea308 Author: KerstinKeller <[email protected]> Date: Tue Aug 20 16:17:23 2024 +0200 [core] remove monitoring timeout (registration timeout is only valid timeout). Set registration timeout to 10 seconds. (eclipse-ecal#1714) commit bda08a6 Author: Rex Schilasky <[email protected]> Date: Tue Aug 20 14:37:30 2024 +0200 python monitoring dictionary enhanced (still not complete) (eclipse-ecal#1715) commit 5779c07 Author: Rex Schilasky <[email protected]> Date: Tue Aug 20 12:00:45 2024 +0200 [sample] sample massive_pub_sub extended (eclipse-ecal#1713) commit d4fd7d6 Author: KerstinKeller <[email protected]> Date: Tue Aug 20 11:49:19 2024 +0200 [core] Rewrite GetTopicsParallel test to be more robust. (eclipse-ecal#1706) commit 9db33c8 Author: Peguen <[email protected]> Date: Tue Aug 20 10:05:06 2024 +0200 [config] Monitoring uses SAttributes instead of config object (eclipse-ecal#1710) commit 998b3ff Author: Peguen <[email protected]> Date: Tue Aug 20 09:01:06 2024 +0200 [GH] Hotfix macos build & dependency (Qt5, capnp, python) brew installation (eclipse-ecal#1711) * Python, Qt5, capnp installation via brew (all latest) * Python packages installation with parameter --break-system-packages * Added Qt5 installation path to the CMAKE_PREFIX_PATH in installation commit c974e6a Author: KerstinKeller <[email protected]> Date: Tue Aug 20 08:44:53 2024 +0200 [core] eCAL sample completely internal, only SEntityId public. (eclipse-ecal#1712) commit 6a44dad Author: Rex Schilasky <[email protected]> Date: Mon Aug 19 16:49:44 2024 +0200 [core] feature/id-based-descgate (eclipse-ecal#1708) descgate API changed to use separate GetEntityIDs() + GetEntityInfo(id) functions instead of single GetEntities() variants commit fe1fe22 Author: Peguen <[email protected]> Date: Mon Aug 19 15:39:17 2024 +0200 [config] Added config object to registration. (eclipse-ecal#1709) * Added Config object to registration. commit f80ce01 Author: KerstinKeller <[email protected]> Date: Tue Aug 13 15:14:56 2024 +0200 [core] warnings and build issue fixes (eclipse-ecal#1707) commit 938c891 Author: KerstinKeller <[email protected]> Date: Mon Aug 12 12:54:52 2024 +0200 [core] unregistration of timed out samples in one central place (instead of all over the place). (eclipse-ecal#1675) Modifies also CExpirationMap interface to return keys and values of expired items. commit 09d2cc8 Author: Peguen <[email protected]> Date: Thu Aug 8 12:11:14 2024 +0200 [config] Added config object to monitoring initialization. (eclipse-ecal#1699) * Added config object to monitoring initialization commit ab0870c Author: Rex Schilasky <[email protected]> Date: Thu Aug 8 11:19:31 2024 +0200 [core] registration specific functions moved from Util:: to Registration:: (eclipse-ecal#1700) * registration specific functions moved from Util:: to Registration:: commit 2b2e4d7 Author: Rex Schilasky <[email protected]> Date: Wed Aug 7 13:39:01 2024 +0200 [core] enable loopback for monitoring functionality (eclipse-ecal#1698) commit 0277978 Author: KerstinKeller <[email protected]> Date: Wed Aug 7 09:52:22 2024 +0200 [core] Remove SPublicationInfo / SSubscriptionInfo type. (eclipse-ecal#1695) Instead Registration::SampleIdentifier are used in datawriter / datareader. commit 5a4300b Author: KerstinKeller <[email protected]> Date: Tue Aug 6 15:34:24 2024 +0200 [core] Registration::SampleIdentifier and partial sample serialization eCAL Registration samples have a command type, and some member types. Now the serialization is performed only partially, according to the command type. Additionally, every sample now has a unique ID, marking the entity which has produced this sample. This info will be unique within the whole eCAL Ecosystem. commit 6886ee4 Author: Rex Schilasky <[email protected]> Date: Tue Aug 6 15:06:48 2024 +0200 [core] remove callbacks before stopping tcp protocol layer (eclipse-ecal#1693) commit 9e8ecbb Author: Peguen <[email protected]> Date: Mon Aug 5 08:22:09 2024 +0200 [config] Updated documentation to new configuration structure (eclipse-ecal#1690) Only doc changes. New yaml references and config settings in code snippets. Issue link for current documentation checkup: eclipse-ecal#1672 commit e6dbb82 Author: Rex Schilasky <[email protected]> Date: Fri Aug 2 16:14:31 2024 +0200 [core] missing include (std::find) (eclipse-ecal#1691) commit a5d9eb4 Author: Peguen <[email protected]> Date: Fri Aug 2 12:12:44 2024 +0200 [config] configuration yaml generation (eclipse-ecal#1680) * Config initialization happens now directly in structure. * Removed eCAL defs except for non configurable defs. * Adapted subscriber configuration to layer::udp as in other structs. * Added yaml creation out of a stringstream while building. * Made yaml-cpp optional again. Added compiler flags depending on ECAL_CORE_CONFIGURATION option to exclude yaml-cpp code. commit 63d1cc2 Author: Rex Schilasky <[email protected]> Date: Tue Jul 30 16:04:12 2024 +0200 [core] zero-copy-zero-payload-shm-transfer (eclipse-ecal#1683) * zero length payload was not transferred over shm in zero copy mode commit 9b4c0d3 Author: KerstinKeller <[email protected]> Date: Tue Jul 30 14:53:07 2024 +0200 [core] Protobuf Publisher Send should return the actual send size. (eclipse-ecal#1681) commit 8f80696 Author: KerstinKeller <[email protected]> Date: Mon Jul 29 17:05:01 2024 +0200 [build] ensure compatibility with yaml-cpp < 0.8.0 (eclipse-ecal#1678) commit 0b60453 Author: Rex Schilasky <[email protected]> Date: Mon Jul 29 14:14:25 2024 +0200 [core] registration-provider-refactoring (eclipse-ecal#1677) * registration provider single threaded sending* * Register(false) calls removed finally * registration provider logic reduced to just send registration samples (connection to descgate, monitoring cut) commit 9110d2a Author: Rex Schilasky <[email protected]> Date: Fri Jul 26 16:47:21 2024 +0200 [core] registration-sender-datarace-fix (eclipse-ecal#1674) commit 2c99f61 Author: Rex Schilasky <[email protected]> Date: Fri Jul 26 16:41:52 2024 +0200 [core] serialization-decode-error-handling (eclipse-ecal#1673) commit 0d361d0 Author: Peguen <[email protected]> Date: Fri Jul 26 14:27:00 2024 +0200 [config] Introduction of YAML format for eCAL configuration (eclipse-ecal#1669) * Changed runtime configuration format from ini to yaml * Implementation of yaml reader * Removing the simple-ini dependency + implementation from core * Implementation of defaults via yaml reading commit 9b5f082 Author: Rex Schilasky <[email protected]> Date: Wed Jul 24 18:43:05 2024 +0200 [core] active-registration-logic-getter (eclipse-ecal#1671) commit 9211a88 Author: KerstinKeller <[email protected]> Date: Wed Jul 24 15:15:01 2024 +0200 [core] further refactoring registration receiver. (eclipse-ecal#1670) commit 21535da Author: Rex Schilasky <[email protected]> Date: Mon Jul 22 13:39:01 2024 +0200 [core] registration-loopback-logic-fixed-for-service-registrations (eclipse-ecal#1667) * registration sample processing (local/network mode, loopback not loopback) handle identically for pub/sub and client/server registration Co-authored-by: Kerstin Keller <[email protected]> commit 3441e62 Author: Rex Schilasky <[email protected]> Date: Thu Jul 18 14:56:46 2024 +0200 [core] new-pub-sub-matching-compatible (eclipse-ecal#1665) commit 4659192 Author: KerstinKeller <[email protected]> Date: Wed Jul 17 18:01:20 2024 +0200 [core] new-pub-sub-matching (eclipse-ecal#1653) Co-authored-by: Rex Schilasky <[email protected]> commit 73f5f3c Author: KerstinKeller <[email protected]> Date: Wed Jul 17 15:04:26 2024 +0200 [core] refactor registration receiver and file structure (eclipse-ecal#1662) commit 15d8354 Author: Rex Schilasky <[email protected]> Date: Wed Jul 17 14:47:05 2024 +0200 [core] sync-with-ecal-core-2024-07-17 (eclipse-ecal#1664) commit 5a835aa Author: Peguen <[email protected]> Date: Mon Jul 15 16:10:32 2024 +0200 [config] cleanup (eclipse-ecal#1655) * Removed unused methods from ecal_config.h * Removed unused member from transport_layer configuration. * Moved num_executor_reader/writer to publisher/subscriber config. * Added new num_execs to API and uses subscriber options for previous implementation calls. commit 6dd1718 Author: Rex Schilasky <[email protected]> Date: Mon Jul 15 16:04:30 2024 +0200 kill XProtect to avoid malware scan of dmg image (eclipse-ecal#1659) commit a51ecec Author: Rex Schilasky <[email protected]> Date: Mon Jul 15 11:48:23 2024 +0200 [core] innosetup-configuration-path-fix (eclipse-ecal#1656) * innosetup path fix "configuration" -> "_configuration" * innosetup path fix "configinstall" -> "_configinstall" commit 4d67a9f Author: KerstinKeller <[email protected]> Date: Fri Jul 12 10:27:08 2024 +0200 [core] registration provider refactoring (eclipse-ecal#1647) * Split logic for registration providers into different files. commit a58f6af Author: KerstinKeller <[email protected]> Date: Wed Jul 10 17:16:51 2024 +0200 [core] Fix bug in frequency calculator that will reset the frequency to 0.0 even though data is still incoming. (eclipse-ecal#1650) commit bd3bfc3 Author: Rex Schilasky <[email protected]> Date: Tue Jul 9 14:04:08 2024 +0200 [core] shm-monitoring-performance (eclipse-ecal#1645) * shm_monitoring logic simplified, based on on switch only (needs to be improved further) * parallel shm_monitoring AND udp_monitoring feature removed * massive_pub_sub sample added to test creation performance of pub/sub for large scenarios and monitoring performance no more remvoval of expired values (erase_expired) in ApplyPub/Sub/Server/ClientDescription because of bad performance * erase_expired removal removed (we need to think about when/where to remove expired values) * shm registration configurable separately (interim solution to get this pr run) commit 7b47978 Author: Rex Schilasky <[email protected]> Date: Fri Jun 28 11:46:39 2024 +0200 [samples] shutdown condition fixed (eclipse-ecal#1641) commit 35c1fd9 Author: Rex Schilasky <[email protected]> Date: Tue Jun 25 15:06:32 2024 +0200 [core] new IsPublished API for CSubscriber, improved state logic for IsPublished and GetPublisherCount commit 55eb50f Author: KerstinKeller <[email protected]> Date: Tue Jun 25 15:04:08 2024 +0200 [core] Refactoring / Renaming / Documentation of CExpMap (eclipse-ecal#1637)
Description
Provide unregistration for timed out participants centrally in one place!