Finalize/Cleaning RTI DDS

8 posts / 0 new
Last post
Offline
Last seen: 6 years 2 months ago
Joined: 08/28/2013
Posts: 66
Finalize/Cleaning RTI DDS

Hello,

I have some errors (data abort on VxWorks) when finalizing all entites and especially subscriber.

My API has one participant, one subscriber, one data_reader with listener.

At finalize, i do the following:
1/DDS_DomainParticipant_delete_topic from participant
2/DDS_DomainParticipant_unregister_type
3/DDS_DomainParticipant_delete_subscriber

Here i got a problem in :

DDS_Subscriber_delete_contained_entities(subscriber);

DomainParticipantEvent_on_before_datareader_deleted();

DPDE_DiscoveryPlugin_after_local_data_reader_deleted();

DPDE_SubscriptionDiscovery_after_local_data_reader_deleted()

DDS_DataWriter_write_untyped()

if (DDS_InstanceHandle_is_nil(handle)) { ... }
else

keyHashBuffer = *(DDS_KeyHash_t *) handle;    <<<<<<<<<<<<<<<<<<<<<<< here is data abort.

What should be do, do clean succesfully the subscriber ?

Best regards,

Rodolf

Offline
Last seen: 6 years 2 months ago
Joined: 08/28/2013
Posts: 66

In fact, it is linked to dpde discovery mechanisms.

The only thing I do is :
RT_Registry_register(registry,"dpde",DPDE_DiscoveryFactory_get_interface(),&discovery_plugin_properties._parent,NULL))
OSAPI_Stdio_snprintf(dp_qos.discovery.discovery.name,8,"dpde");

And when calling
DDS_DomainParticipantFactory_delete_participant, i got always an exception when finalizing participant.disc_plugin

Any Idea ?

 

Offline
Last seen: 2 weeks 12 hours ago
Joined: 09/10/2010
Posts: 32

Hello Rodolf,

     In our example application that we ship with Micro, we have the following routine that is used to clean up the application and entities.  Does this help any...

 

void

Application_delete(struct Application *application)

{

    DDS_ReturnCode_t retcode;

 

    DDS_DomainParticipant_delete_contained_entities(application->participant);

 

    if (DDS_DomainParticipant_unregister_type(application->participant,

                                         application->type_name) !=

        HelloWorldTypePlugin_get())

    {

        printf("failed to unregister type: %s\n", application->type_name);

        return;

    }

 

    retcode =

        DDS_DomainParticipantFactory_delete_participant

        (DDS_DomainParticipantFactory_get_instance(), application->participant);

    if (retcode != DDS_RETCODE_OK)

    {

        printf("failed to delete participant: %d\n", retcode);

        return;

    }

 

    free(application);

 

    DDS_DomainParticipantFactory_finalize_instance();

}

 
Offline
Last seen: 6 years 2 months ago
Joined: 08/28/2013
Posts: 66

No it doesn t help in fact.
Error is in

    DDS_DomainParticipant_delete_contained_entities(application->participant);

because of discovery QoS

Offline
Last seen: 2 years 3 months ago
Joined: 01/17/2013
Posts: 13

Hello Rodolf,

Can you share more of your code? I am not able to reproduce what you are seeing.

You describe the following sequence:

1/DDS_DomainParticipant_delete_topic from participant
2/DDS_DomainParticipant_unregister_type
3/DDS_DomainParticipant_delete_subscriber

Then you say this function is called:

DDS_Subscriber_delete_contained_entities(subscriber);

However, this function is not called by DDS_DomainParticipant_delete_subscriber so it is not clear to me what the calling sequence is. Also, based on 1-3 above, it is not legal to delete a topic currently in use by a data-reader (assuming the reader is within the subscriber deleted in 3). Thus, 2 is also not legal (assuming the type is used by the topic in 1).

In general:

1. Delete data-reader and data-writers
2. Delete publisher and subscribers
3. Unregister types from the participant (delete_contained does not delete types)
4. Delete the participant
5. Unregister all plugins from the domain-participant factory
6. Finalize the domain participant factory

1 and 2 can be accomplished by calling DomainParticipant_delete_contained_entities.

tron

Offline
Last seen: 6 years 2 months ago
Joined: 08/28/2013
Posts: 66

Hi tron,

The sequence of cleaning is the one i have done.

In fact when i do:
*register udp,rh,wh,dpde
*create a participant
*register type
*unregister type
*call participant_delete_entities
*call factory_delete_participant
*unregister rh,wh,udp,dpde
*call finalize factory

And i have an error :

[1381751227.734602998] ERROR:ModuleID=2,Errcode=21,X=1,E=0,STATUS=f8000040  empty/DBUrtdb.c:958/DB_Database_delete_table:table=ty1

[1381751227.736603998] ERROR:ModuleID=7,Errcode=8,X=1,E=0,STATUS=f8000060  empty/DomainParticipant.c:736/DDS_DomainParticipant_finalize:name=type,dbrc=2

failed to delete participant: 1
[1381751227.741604998] ERROR:ModuleID=1,Errcode=8,X=1,E=0,STATUS=f8000004  empty/REDABufferPool.c:162/REDA_BufferPool_delete:count=1


 

Offline
Last seen: 2 years 3 months ago
Joined: 01/17/2013
Posts: 13

Hi Rodolf,

The error message means that there is 1 type registered on the DomainParticipant. Did the unregister type call succeed? The sequence above does not indicate that a topic was created, but if one was created for the type it must be deleted before the type can be unregistered.

Can you duplicate this problem with the examples shipped with RTI Connext Micro? Attached is a modified example that executes the sequence listed above, and it works as expected.

regards,

tron

 

File Attachments: 
Offline
Last seen: 6 years 2 months ago
Joined: 08/28/2013
Posts: 66

Hi Tron,

I agree, your example is working.
I add some entities to be more similar to my test case and so i added after participant's creation

*a publisher

*creation of a topic

*creation of a datawriter

And then all the cleaning/finalize

And if i add delete_topic() before unregister, unregister does not work, but unregister followed by delete_topic is OK

Normal behaviour:

everything is OK if i don t put delete_topic (based on your example)
if i add delete_topic i have following error:

[7.183333327] ERROR:ModuleID=1,Errcode=8,X=1,E=0,STATUS=f8000044
  empty/REDABufferPool.c:162/REDA_BufferPool_delete:count=-1

[7.199999993] ERROR:ModuleID=2,Errcode=21,X=1,E=0,STATUS=f8000040
  empty/DBUrtdb.c:977/DB_Database_delete_table:table=to1

[7.199999993] ERROR:ModuleID=7,Errcode=8,X=1,E=0,STATUS=f8000060
  empty/DomainParticipant.c:735/DDS_DomainParticipant_finalize:name=topic,dbrc=2

0x804d356c (PM_PIL): DDS Delete Participant is KO
[7.216666659] ERROR:ModuleID=1,Errcode=8,X=1,E=0,STATUS=f8000044
  empty/REDABufferPool.c:162/REDA_BufferPool_delete:count=1

My behaviour:

I am working on vxWorks with other tasks. And if i don t put either delete_publisher or delete_topic, the cleaning step is stucked because it waits for a semaphore that DDS is not having.
If i add delete_publisher() i have some errors (same as above)
if i remove delete_publisher, then the finalize step is stucked forever in DDS_DomainParticipant_finalize at line 756 (micro edition 2.2.3) :

!NETIO_BindResolver_release_addresses(participant->bind_resolver,(struct REDA_StringSeq*)&participant->qos.transports.enabled_transports,

NETIO_ROUTEKIND_META,(struct NETIO_AddressSeq*)&participant->builtin_data.metatraffic_multicast_locators))

Strange no ?

Regards,

Rodolf