-
Notifications
You must be signed in to change notification settings - Fork 342
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
CycloneDDS subscriber fails to deserialize a XTypes appendable enumeration #1926
Comments
Hi @jeffpg144, you raise an interesting issue. I would say that what Cyclone does is in line with the specs: XTypes 1.3, 7.2.4.4.7 "Enumerated Types", table 18 gives for
and for "Object construction":
I read that "the object cannot construct any object of type T1" that the deserialised must reject the sample. I suppose this is debatable because makes the concept of But then, this:
Is a tad problematic at least formally on the grounds of IDL 4.2, 7.4.1.4.4.4.3 "Enumerations", which says
So technically it is possible to do 2^32 symbols that get mapped to a 32-bit integer in C (most traditional C99 implementations) and hence that "bad value" may not be possible. It is a bit formalistic, I admit. More problematic to me is that the IDL-to-C++ language mapping spec states:
The IDL-to-C++ language mapping spec is oldish, the one for Java is much newer (2019, IDL4, so post-XTypes):
So also no additional magic values. I can't find anything that says these rules do not apply to "appendable" enumerate types. So it is at best murky territory ... There is an obvious solution to it that I like much better than defining magic additional symbols, which is to leave it to the application. An annotation that specifies which value to use for out-of-range inputs when deserialising, perhaps with a fallback to the "default literal" would be much better, in my view. But right now, no, Cyclone doesn't do that either ... |
@eboasson Thanks for the detailed comments. My following up thoughts.
It seems like Cyclone DDS could consider #3 first and add #4 in the future. My application does depend on appendable enumerations and the other organizations I'm collaborating with are interested in Cyclone DDS but this would be a show stopper for now. |
Summary
CycloneDDS subscriber fails to deserialize a XTypes appendable enumeration from a publisher sending a new enumerated value.
[localhost build]$ idlc -v
idlc (Eclipse Cyclone DDS) 0.11.0
Hello World, #1
Hello World, #2
Common Changes to Hello World Example
Test Results
Pass
o HW #1 pub to HW #1 sub
o HW #1 pub to HW #2 sub
o HW #2 pub to HW #1 sub when sending existing enumerated color.
o HW #2 pub to HW #2 sub
Failed
o HW #2 pub to HW #1 subs when sending new enumerated value/color.
The follpwing is printed to the console.
“1706620617.096516 [0] recvMC: data(application, vendor 1.16): 110fd27:cd3514d3:a0cdd270:202 #2: deserialization HelloWorldData_Msg/HelloWorldData::Msg failed (for reasons unknown)”
Expected Behavior
• Expect HW #1 subscriber to deserialize published data and assigned the enumeration with a default value of 0. This is what happens for the newID field, HW #2 subscriber has a value of 0 for published samples from HW #1.
• Other OMG-DDS vendors code generate an additional value for all enumerations that indicate an “UNKNOWN VALUE” or “BAD VALUE”. Looking at the generated c code, I do not see an additional enumerated value.
• After reviewing X-Types Release Notes https://github.com/eclipse-cyclonedds/cyclonedds/blob/master/docs/dev/xtypes_relnotes.md this is no mention of appendable enumerations not being supported.
Things I’ve Already Tried
• Verify the IDL syntax for extensibility is correct. Using “@appendable” before the enumeration and structure
• Make sure the structure containing the enumeration is also appendable.
• Updated the idlc command line to include -Werror -x appendable -f cdrstream-desc
Source code for both Hello World #1 and #2.
examples_helloworld.zip
I have ~5 years experience working with other OMG-DDS vendor software. I have recently started to test interoperability with CycloneDDS focusing on XTypes.
The text was updated successfully, but these errors were encountered: