Skip to content

Commit fc2fb99

Browse files
Support Type-Lookup Service with new new GUID-less Discovery Server (#4768)
* Refs #20953: TLU_request instance name made from CacheChange writer GUID instead of proxy_data Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20953: Add Warning for backup with XTypes Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #20953: Update versions.md Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent 3dd5cfe commit fc2fb99

5 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,20 @@ SampleIdentity TypeLookupManager::get_types(
312312

313313
ReturnCode_t TypeLookupManager::async_get_type(
314314
eprosima::ProxyPool<eprosima::fastdds::rtps::WriterProxyData>::smart_ptr& temp_writer_data,
315+
const fastdds::rtps::GUID_t& type_server,
315316
const AsyncGetTypeWriterCallback& callback)
316317
{
317318
return check_type_identifier_received<eprosima::fastdds::rtps::WriterProxyData>(
318-
temp_writer_data, callback, async_get_type_writer_callbacks_);
319+
temp_writer_data, type_server, callback, async_get_type_writer_callbacks_);
319320
}
320321

321322
ReturnCode_t TypeLookupManager::async_get_type(
322323
eprosima::ProxyPool<eprosima::fastdds::rtps::ReaderProxyData>::smart_ptr& temp_reader_data,
324+
const fastdds::rtps::GUID_t& type_server,
323325
const AsyncGetTypeReaderCallback& callback)
324326
{
325327
return check_type_identifier_received<eprosima::fastdds::rtps::ReaderProxyData>(
326-
temp_reader_data, callback, async_get_type_reader_callbacks_);
328+
temp_reader_data, type_server, callback, async_get_type_reader_callbacks_);
327329
}
328330

329331
TypeKind TypeLookupManager::get_type_kind_to_propagate() const
@@ -346,6 +348,7 @@ TypeKind TypeLookupManager::get_type_kind_to_propagate() const
346348
template <typename ProxyType, typename AsyncCallback>
347349
ReturnCode_t TypeLookupManager::check_type_identifier_received(
348350
typename eprosima::ProxyPool<ProxyType>::smart_ptr& temp_proxy_data,
351+
const fastdds::rtps::GUID_t& type_server,
349352
const AsyncCallback& callback,
350353
std::unordered_map<xtypes::TypeIdentfierWithSize,
351354
std::vector<std::pair<ProxyType*,
@@ -356,7 +359,6 @@ ReturnCode_t TypeLookupManager::check_type_identifier_received(
356359
TK_NONE ?
357360
temp_proxy_data->type_information().type_information.complete().typeid_with_size() :
358361
temp_proxy_data->type_information().type_information.minimal().typeid_with_size();
359-
fastdds::rtps::GUID_t type_server = temp_proxy_data->guid();
360362

361363
// Check if the type is known
362364
if (fastdds::rtps::RTPSDomainImpl::get_instance()->type_object_registry_observer().

src/cpp/fastdds/builtin/type_lookup_service/TypeLookupManager.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,19 @@ class TypeLookupManager
180180
* Use builtin TypeLookup service to solve the type and dependencies of a given TypeInformation.
181181
* It receives a callback that will be used to notify when the negotiation is complete.
182182
* @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request.
183+
* @param type_server[in] GUID of the remote participant that has the type.
183184
* @param callback Callback called when the negotiation is complete.
184185
* @return ReturnCode_t RETCODE_OK if the type is already known.
185186
* RETCODE_NO_DATA if type is not known, and a negotiation has been started.
186187
* RETCODE_ERROR if any request was not sent correctly.
187188
*/
188189
ReturnCode_t async_get_type(
189190
eprosima::ProxyPool<eprosima::fastdds::rtps::WriterProxyData>::smart_ptr& temp_proxy_data,
191+
const fastdds::rtps::GUID_t& type_server,
190192
const AsyncGetTypeWriterCallback& callback);
191193
ReturnCode_t async_get_type(
192194
eprosima::ProxyPool<eprosima::fastdds::rtps::ReaderProxyData>::smart_ptr& temp_proxy_data,
195+
const fastdds::rtps::GUID_t& type_server,
193196
const AsyncGetTypeReaderCallback& callback);
194197

195198
/**
@@ -205,6 +208,7 @@ class TypeLookupManager
205208
* Adds a callback to the async_get_type_callbacks_ entry of the TypeIdentfierWithSize, or creates a new one if
206209
* TypeIdentfierWithSize was not in the map before
207210
* @param temp_proxy_data[in] Temporary Writer/Reader ProxyData that originated the request.
211+
* @param type_server[in] GUID of the remote participant that has the type.
208212
* @param callback[in] Callback to add.
209213
* @param async_get_type_callbacks[in] The collection ProxyData and their callbacks to use.
210214
* @return ReturnCode_t RETCODE_OK if type is known.
@@ -214,6 +218,7 @@ class TypeLookupManager
214218
template <typename ProxyType, typename AsyncCallback>
215219
ReturnCode_t check_type_identifier_received(
216220
typename eprosima::ProxyPool<ProxyType>::smart_ptr& temp_proxy_data,
221+
const fastdds::rtps::GUID_t& type_server,
217222
const AsyncCallback& callback,
218223
std::unordered_map<xtypes::TypeIdentfierWithSize,
219224
std::vector<std::pair<ProxyType*,

src/cpp/rtps/builtin/BuiltinProtocols.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ bool BuiltinProtocols::initBuiltinProtocols(
113113

114114
#if HAVE_SQLITE3
115115
case DiscoveryProtocol::BACKUP:
116+
EPROSIMA_LOG_WARNING(RTPS_PDP, "BACKUP discovery protocol is not yet supported with XTypes.");
116117
mp_PDP = new fastdds::rtps::PDPServer(this, allocation, DurabilityKind_t::TRANSIENT);
117118
break;
118119
#endif // if HAVE_SQLITE3

src/cpp/rtps/builtin/discovery/endpoint/EDPSimpleListeners.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void EDPBasePUBListener::add_writer_from_change(
7373
const NetworkFactory& network = edp->mp_RTPSParticipant->network_factory();
7474
CDRMessage_t tempMsg(change->serializedPayload);
7575
auto temp_writer_data = edp->get_temporary_writer_proxies_pool().get();
76+
const auto type_server = change->writerGUID;
7677

7778
if (temp_writer_data->readFromCDRMessage(&tempMsg, network,
7879
edp->mp_RTPSParticipant->has_shm_transport(), true, change->vendor_id))
@@ -141,6 +142,7 @@ void EDPBasePUBListener::add_writer_from_change(
141142
{
142143
typelookup_manager->async_get_type(
143144
temp_writer_data,
145+
type_server,
144146
after_typelookup_callback);
145147
}
146148
// If TypeInformation does not exist, try fallback mechanism
@@ -216,6 +218,7 @@ void EDPBaseSUBListener::add_reader_from_change(
216218
const NetworkFactory& network = edp->mp_RTPSParticipant->network_factory();
217219
CDRMessage_t tempMsg(change->serializedPayload);
218220
auto temp_reader_data = edp->get_temporary_reader_proxies_pool().get();
221+
const auto type_server = change->writerGUID;
219222

220223
if (temp_reader_data->readFromCDRMessage(&tempMsg, network,
221224
edp->mp_RTPSParticipant->has_shm_transport(), true, change->vendor_id))
@@ -285,6 +288,7 @@ void EDPBaseSUBListener::add_reader_from_change(
285288
{
286289
typelookup_manager->async_get_type(
287290
temp_reader_data,
291+
type_server,
288292
after_typelookup_callback);
289293
}
290294
// If TypeInformation does not exist, try fallback mechanism

versions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ Forthcoming
9696
* Servers only redirect discovery information of their direct clients.
9797
* Remote Discovery servers connection list can now be updated and modified at runtime without restrictions.
9898
* Fast DDS CLI has been updated to allow the creation of servers without GUID.
99+
* Servers are responsible of answering TypeLookupRequests of others servers when working with X-Types.
100+
* Backup server is not compatible with X-Types.
99101
* Refactor in XML Parser to return DynamicTypeBuilder instead of DynamicType
100102
* Setting vendor_id in the received CacheChange_t for Data and DataFrag.
101103
* Added new DynamicData to JSON serializer (`json_serialize`).

0 commit comments

Comments
 (0)