-
Notifications
You must be signed in to change notification settings - Fork 793
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
A subscriber receives RETCODE_NO_DATA with dynamic topic type with @key or @Key [13696] #2215
Comments
It would be great if someone in the fast-dds team could look into this issue. |
Related to #2064 @MiguelCompany After spending some time, I found out that when I create Also I found that currently FastDDSGen generates the diff --git a/include/fastrtps/types/AnnotationDescriptor.h b/include/fastrtps/types/AnnotationDescriptor.h
index 2e6762277..365353dae 100644
--- a/include/fastrtps/types/AnnotationDescriptor.h
+++ b/include/fastrtps/types/AnnotationDescriptor.h
@@ -30,10 +30,10 @@ class AnnotationDescriptor
protected:
friend class DynamicTypeBuilderFactory;
- DynamicType_ptr type_;
std::map<std::string, std::string> value_;
public:
+ DynamicType_ptr type_;
AnnotationDescriptor();
~AnnotationDescriptor();
AnnotationDescriptor(const AnnotationDescriptor* descriptor);
diff --git a/src/cpp/dynamic-types/MemberDescriptor.cpp b/src/cpp/dynamic-types/MemberDescriptor.cpp
index 755724b9c..5f78048c8 100644
--- a/src/cpp/dynamic-types/MemberDescriptor.cpp
+++ b/src/cpp/dynamic-types/MemberDescriptor.cpp
@@ -702,6 +702,10 @@ ReturnCode_t MemberDescriptor::apply_annotation(AnnotationDescriptor& descriptor
{
AnnotationDescriptor* pNewDescriptor = new AnnotationDescriptor();
pNewDescriptor->copy_from(&descriptor);
+ if (pNewDescriptor->type_->get_name() == "Key" || pNewDescriptor->type_->get_name() == "key") {
+ pNewDescriptor->type_->is_key_defined_ = true;
+ this->type_->is_key_defined_ = true;
+ }
annotation_.push_back(pNewDescriptor);
return ReturnCode_t::RETCODE_OK;
}
|
@davidhjp01 Thank you very much for taking the time to analyze this. My colleague @richiware has recently created PR #2262, which may be a solution for your issue. I would like his input on your workaround. It seems to me that the key annotations should be applied both to the members and the |
Sorry for the inconveniences @davidhjp01 . If you are using Thanks |
Thanks for the follow ups. I tried bugfix/support-Key-annotation but unfortunately I am still getting return code 11. I didn't look carefully into the changes but just tried rebuilt/run tests with the branch. |
@MiguelCompany, @richiware One question regarding auto comp = [](const InstanceHandle_t& h, const std::pair<InstanceHandle_t, KeyedChanges>& it)
{
return h < it.first;
};
it = std::upper_bound(keyed_changes_.begin(), keyed_changes_.end(), handle, comp); only returns the element in As a result, FastDDS always returns keyed data when the keyed value is greater than 0. And I am getting |
I am closing this issue, as it seems that #2316 fixed it, as @davidhjp01 said in this comment in #2306. |
A subscriber receives return code
RETCODE_NO_DATA
when a publisher sends a data created usingDynamicTypeBuilderFactory
with@Key
or@key
annotation.Expected Behavior
A subscriber receives a data sent by a publisher
Current Behavior
A subscriber's listener function
on_data_available
is invoked for each data sent by publisher butread_next_sample
returnsRETCODE_NO_DATA
Steps to Reproduce
@key
annotation for one or more of its members) using fastddsgen with -typeobject argumentSystem information
Intel i9-10885H 32GB RAM
Not specified, uses simple discovery mechanism
Additional context
Additional resources
The text was updated successfully, but these errors were encountered: