Issues/bugs with Connext-Py

4 posts / 0 new
Last post
Offline
Last seen: 1 year 11 months ago
Joined: 01/06/2023
Posts: 2
Issues/bugs with Connext-Py

Hi all,

I am currenlty testing the 7.0.0 EAR version with the new Python API Connext-Py and I have encountered several issues/bugs and was wondering what should/could I do to report them.

Here is the list:

Namespace separator in topic type name

I have an idl with a topic "MyTopic" within a namespace "MyNamespace".
When I make two connext-py application publish/subscribe this topic the discovery works as expected. But if I try to communicate with a Java application the discovery only works with small topics (I mean with a small type information).

After further investigations with rti logs I discovered that in connext-py the separator between namepace and topic name in type name is "_" whereas its "::" in C++ et Java applications.
And if the topic is small the type information is transmitted during discovery allowing subscription/publication match, but for larger topics the match fails as "MyNamespace::MyTopic" is different from "MyNamespace_MyTopic".
Using rtiddsspy confirms this behavior as topic name is not same when published from a Java application and a Python application.

Deadlock in dds.Topic constructor

I had difficulties understand what was really going on, but it seems that if I call the dds.Topic constructor while a subscription is being matched, a deadlock occurs and the call to the constructor never ends.

In my application I was doing:

  • Create topic A
  • Create reader on topic A
  • Create topic B
  • Create reader on topic B

And it seems that if a writer is present when starting the application and the subscription match occurs when creating topic B the deadlock occurs.
I found a workaround by creating all the topics before creating the readers and the issue never appeared again.

Policy property issue


In the on_requested_incompatible_qos() callback, I can't print the content of last_policy: if the policy is a 'liveliness' instance, when trying to display lease_duration I get '<property object at 0xXXXXX>' which appears to be related to a bad declaration of the property (done in the instance and not the class itself).

Liveliness match

I didn't spend much time trying to caracterize this issue but using qos configuration that works well in C++ and Java produce an incompatible qos issue and the last_policy in the on_requested_incompatible_qos callback is a liveliness instance. And since I am unable to print lease_duration/kind it's difficult to understand what the issue is.

 

Michael

Offline
Last seen: 2 months 2 weeks ago
Joined: 04/02/2013
Posts: 196

Hi Michael,

Regarding the namespace separator, there is an issue in how the type name is registered in Python and we're looking into it. At this moment you need to make sure the TypeObject is propagated, so the reader/writer match is based on type definition, not on type name. (See https://community.rti.com/static/documentation/connext-dds/7.0.0/doc/manuals/connext_dds_professional/extensible_types_guide/extensible_types/Type_Representation.htm#gettingstartedwithextensibletypes_2106834040_1140701)

The object you see in the last_policy field is expected. That field is only supposed to indicate which policy was incompatible, but not the actual configuration. For example, in the C++ API, that field is just an integer that identifies the policy ID. In Python it's the type of the policy (e.g. this is True: "status.last_policy is Liveliness"). To get more information about the Qos incompatibility, you can use Admin Console.

We haven't seen the deadlock in the Topic constructor, do you have a simple example that reproduces the error so we can look into it?

Thanks!

Alex

Offline
Last seen: 1 year 11 months ago
Joined: 01/06/2023
Posts: 2

Hi Alex,

Concerning namespace I ended up patching type_plugin.py in idl_impl to manualy change the type name. Not so clean, but it will do the trick until official support.
I did take a look at TypeObject but the software I am interacting with cannot be modified and TypeObject size can't be changed.

I didn't had time to check why the liveliness was causing discovery issues.

For the deadlock I managed to reproduce the issue with a small example I attached.
To reproduce: start pub.py, start sub.py and wait.
The deadlock occurs when "Create topic 2" isn't followed by "Topic 2 created".
I am using connext-py 7.0.0 on Ubuntu 18.04 and Python 3.6.9.

Michael

File Attachments: 
Offline
Last seen: 2 months 2 weeks ago
Joined: 04/02/2013
Posts: 196

Thanks for providing the code. I've been able to find and solve the problem. A fix will be included in the next release. 

The next release will also include a Topic __init__ function that allows specifying a custom type name.