I'm running v5 and it seems that by default the maximum participant index is set to 9. If I try to create more than this on a single machine I get:
[CREATE Participant]PRESPsService_new:!create worker-specific object
[CREATE Participant]DDS_DomainParticipantService_initialize:!create publish/subscribe service (participant_index collision?)
[CREATE Participant]DDS_DomainParticipant_createI:!initialize publish/subscribe service
[CREATE Participant]DDS_DomainParticipantDatabase_prefinalize:!database shutdown timeout
[CREATE Participant]RTIEventActiveDatabase_delete:!precondition
[CREATE Participant]DDS_DomainParticipantDatabase_finalize:!delete database
[CREATE Participant]RTIOsapiSemaphore_delete:!delete mutex
[CREATE Participant]DDS_DomainParticipantFactory_create_participant_disabledI:!create participant
DDSDomainParticipant_impl::create_disabledI:!create participant
DDSDomainParticipant_impl::createI:!create participant
DomainParticipantFactory_impl::create_participant():!create failure creating participant
I've seen different places mention that I can increase this limit, but I can't find the right API call or configuration setting to do so.
Anyone know?
Edit:
Digging into this a little further, I see
[D0000|ENABLE]DDS_DomainParticipantPresentation_reserve_participant_indexI:Domain 0:Trying to reserve participant index=8...
[D0000|ENABLE]DDS_DomainParticipantPresentation_reserve_participant_indexI:Domain 0:USING PARTICIPANT INDEX=8
that happen for two entities in the debug output. I'm letting the domain participant pick it's participant ID, but it seems DDS has chosen 8 twice...
Hi,
The limit on the number of participant indices (also called participant_id in the documentation) in a single computer (for a given DomainId, e.g. domainId = 0 ) comes from the algorithm used to assign UDP port numbers and by default the limit is 120. So you are definitely not hitting this limit...
Normally when you get an error such as the above it is that you are hitting some resource limit... This may be due to default internal settings.
What Operating System are you running on?
Are you starting all these DomainParticipants in the same application/process or are they independent applications/processes?
The fact that you are seeing prticipant index 8 selected twice may indicate some race condition. You could try manually setting the participant_index to a differernt value (instead of letting the auto-asign algorithm do its work). The participant_id can be set using the WireProtocolQosPolicy (attribute participant_id). You have to set it prior to creating the DomainParticipant and you can do this in code or via the XML QoS profile configuration file.
If setting the participant_id explicitly works then it would indicate a race condition. If it does not work it may shed light over the kind of resource limit you are hitting. Once we know the operating system you are using we could try to reproduce it as well.
Regards,
Gerado
Hi Gerardo,
Thanks for the response. I'm running CentOS 6.3 (x64). I'm starting all domain participants in the same process. I don't think it's a race condition. I wrote a very simple application that can re-create the problem below. I did try manually assigning the participant id, but that didn't seem to help.
#include "ndds/ndds_namespace_cpp.h"
#include "ndds/ndds_cpp.h"
int main() {
for (int i = 1; i < 30; i++) {
DDS::DomainParticipantQos qos;
DDS::DomainParticipantFactory::get_instance()->get_default_participant_qos(qos);
qos.wire_protocol.participant_id = i;
// ignoring memory leak
DDS::DomainParticipant *part =
DDS::DomainParticipantFactory::get_instance()->create_participant(
0, qos, NULL, DDS::STATUS_MASK_NONE);
if (part == NULL) {
printf("Failed to create participant\n");
exit(1);
}
}
}
After running that, I still see the same index collision in the error output. It doesn't pick 8 twice anymore, but still fails at index 9.
<snip>
[D0800|ENABLE]DDS_DomainParticipantPresentation_reserve_participant_indexI:Domain 0:Trying to reserve participant index=8...
[D0800|ENABLE]DDS_DomainParticipantDiscovery_enableI:value of: initial_peers="builtin.udpv4://239.255.0.1,builtin.udpv4://127.0.0.1,builtin.shmem://"
[D0800|ENABLE]DDS_DomainParticipantDiscovery_add_peer:no peer locators for: peer descriptor(s) = "builtin.shmem://", transports = "", enabled_transports = ""
[D0800|ENABLE]DDS_DomainParticipant_enableI:enabled
[CREATE Participant]DDS_DomainParticipantDiscovery_initialize:builtin discovery plugin PA Client disabled
[CREATE Participant]DDS_DomainParticipantMonitoring_initializeI:monitoring not configured
[CREATE Participant]DDS_DomainParticipantFactory_create_participant_disabledI:created participant: domain=0, index=9
[D0900|ENABLE]DDS_PropertySeq_ensure_length:memory allocation: original 0, new 32
[D0900|ENABLE]DDS_DomainParticipantPresentation_reserve_participant_indexI:Domain 0:Trying to reserve participant index=9...
[D0900|ENABLE]DDS_DomainParticipantPresentation_reserve_participant_indexI:Domain 0:Trying to reserve participant index=9...
[D0900|ENABLE]DDS_DomainParticipantDiscovery_enableI:value of: initial_peers="builtin.udpv4://239.255.0.1,builtin.udpv4://127.0.0.1,builtin.shmem://"
[D0900|ENABLE]DDS_DomainParticipantDiscovery_add_peer:no peer locators for: peer descriptor(s) = "builtin.shmem://", transports = "", enabled_transports = ""
[D0900|ENABLE]DDS_DomainParticipant_enableI:enabled
[CREATE Participant]PRESPsService_new:!create worker-specific object
[CREATE Participant]DDS_DomainParticipantService_initialize:!create publish/subscribe service (participant_index collision?)
[CREATE Participant]DDS_DomainParticipant_createI:!initialize publish/subscribe service
[CREATE Participant]DDS_DomainParticipantDatabase_prefinalize:!database shutdown timeout
[CREATE Participant]RTIEventActiveDatabase_delete:!precondition
[CREATE Participant]DDS_DomainParticipantDatabase_finalize:!delete database
[CREATE Participant]RTIOsapiSemaphore_delete:!delete mutex
[CREATE Participant]DDS_DomainParticipantFactory_create_participant_disabledI:!create participant
DDSDomainParticipant_impl::create_disabledI:!create participant
DDSDomainParticipant_impl::createI:!create participant
DomainParticipantFactory_impl::create_participant():!create failure creating participant
I think I have found the issue here:
http://community.rti.com/kb/how-many-domain-participants-can-be-created-single-address-space
I am running into a system resource issue like you said.