eclipse-cyclonedds / cyclonedds-python

Other
59 stars 47 forks source link

CLI id filter not working #194

Closed jc211 closed 1 year ago

jc211 commented 1 year ago

Hi,

I'm creating a domain and a participant with id=230 on the loopback interface. I think this being done correctly because the debug data confirms the id (see below).

The problem is the participant is only visible when writing cyclonedds ps --id 0 and nothing shows up with cyclonedds ps --id 230

I'm not sure how this is possible unless the domain id is not actually being set.

1685511906.299244 [230] HelloWorld: config: Domain/General/MulticastRecvNetworkInterfaceAddresses/#text: preferred {}
1685511906.299296 [230] HelloWorld: config: Domain/General/Interfaces/NetworkInterface[@autodetermine]: false {}
1685511906.299310 [230] HelloWorld: config: Domain/General/Interfaces/NetworkInterface[@name]: lo {0}
1685511906.299319 [230] HelloWorld: config: Domain/General/Interfaces/NetworkInterface[@address]:  {}
1685511906.299331 [230] HelloWorld: config: Domain/General/Interfaces/NetworkInterface[@priority]: default {}
1685511906.299349 [230] HelloWorld: config: Domain/General/Interfaces/NetworkInterface[@prefer_multicast]: false {}
1685511906.299372 [230] HelloWorld: config: Domain/General/Interfaces/NetworkInterface[@presence_required]: true {}
1685511906.299390 [230] HelloWorld: config: Domain/General/Interfaces/NetworkInterface[@multicast]: default {}
1685511906.299413 [230] HelloWorld: config: Domain/General/ExternalNetworkAddress/#text: auto {}
1685511906.299432 [230] HelloWorld: config: Domain/General/ExternalNetworkMask/#text: 0.0.0.0 {}
1685511906.299450 [230] HelloWorld: config: Domain/General/AllowMulticast/#text: default {}
1685511906.299470 [230] HelloWorld: config: Domain/General/MulticastTimeToLive/#text: 32 {}
1685511906.299489 [230] HelloWorld: config: Domain/General/DontRoute/#text: false {}
1685511906.299509 [230] HelloWorld: config: Domain/General/Transport/#text: udp {}
1685511906.299527 [230] HelloWorld: config: Domain/General/EnableMulticastLoopback/#text: true {}
1685511906.299547 [230] HelloWorld: config: Domain/General/MaxMessageSize/#text: 14720 B {}
1685511906.299565 [230] HelloWorld: config: Domain/General/MaxRexmitMessageSize/#text: 1456 B {}
1685511906.299583 [230] HelloWorld: config: Domain/General/FragmentSize/#text: 1344 B {}
1685511906.299600 [230] HelloWorld: config: Domain/General/RedundantNetworking/#text: false {}
1685511906.299617 [230] HelloWorld: config: Domain/General/EntityAutoNaming/#text: empty {}
1685511906.299639 [230] HelloWorld: config: Domain/General/EntityAutoNaming[@seed]: 2668200165 2801749061 778709013 4278905900 351109621 3568361813 4182068813 2133697971 {}
1685511906.299667 [230] HelloWorld: config: Domain/Sizing/ReceiveBufferSize/#text: 1 MiB {}
1685511906.299685 [230] HelloWorld: config: Domain/Sizing/ReceiveBufferChunkSize/#text: 128 KiB {}
1685511906.299703 [230] HelloWorld: config: Domain/Compatibility/StandardsConformance/#text: lax {}
1685511906.299720 [230] HelloWorld: config: Domain/Compatibility/ExplicitlyPublishQosSetToDefault/#text: false {}
1685511906.299737 [230] HelloWorld: config: Domain/Compatibility/ManySocketsMode/#text: single {}
1685511906.299754 [230] HelloWorld: config: Domain/Compatibility/AssumeRtiHasPmdEndpoints/#text: false {}
1685511906.299773 [230] HelloWorld: config: Domain/Discovery/Tag/#text:  {}
1685511906.299793 [230] HelloWorld: config: Domain/Discovery/ExternalDomainId/#text: 230 {}
1685511906.299810 [230] HelloWorld: config: Domain/Discovery/DSGracePeriod/#text: 30 s {}
1685511906.299828 [230] HelloWorld: config: Domain/Discovery/ParticipantIndex/#text: none {}
1685511906.299846 [230] HelloWorld: config: Domain/Discovery/MaxAutoParticipantIndex/#text: 9 {}
1685511906.299862 [230] HelloWorld: config: Domain/Discovery/SPDPMulticastAddress/#text: 239.255.0.1 {}
1685511906.299881 [230] HelloWorld: config: Domain/Discovery/SPDPInterval/#text: 30 s {}
1685511906.299901 [230] HelloWorld: config: Domain/Discovery/DefaultMulticastAddress/#text: auto {}
1685511906.299922 [230] HelloWorld: config: Domain/Discovery/Ports/Base/#text: 7400 {}
1685511906.299940 [230] HelloWorld: config: Domain/Discovery/Ports/DomainGain/#text: 250 {}
1685511906.299961 [230] HelloWorld: config: Domain/Discovery/Ports/ParticipantGain/#text: 2 {}
1685511906.299978 [230] HelloWorld: config: Domain/Discovery/Ports/MulticastMetaOffset/#text: 0 {}
1685511906.299996 [230] HelloWorld: config: Domain/Discovery/Ports/UnicastMetaOffset/#text: 10 {}
1685511906.300014 [230] HelloWorld: config: Domain/Discovery/Ports/MulticastDataOffset/#text: 1 {}
1685511906.300031 [230] HelloWorld: config: Domain/Discovery/Ports/UnicastDataOffset/#text: 11 {}
1685511906.300048 [230] HelloWorld: config: Domain/Discovery/EnableTopicDiscoveryEndpoints/#text: false {}
1685511906.300067 [230] HelloWorld: config: Domain/Discovery/LeaseDuration/#text: 10 s {}
1685511906.300092 [230] HelloWorld: config: Domain/Tracing/Category/#text: config {0}
1685511906.300111 [230] HelloWorld: config: Domain/Tracing/OutputFile/#text: stdout {0}
1685511906.300127 [230] HelloWorld: config: Domain/Tracing/AppendToFile/#text: false {}
1685511906.300144 [230] HelloWorld: config: Domain/Tracing/PacketCaptureFile/#text:  {}
1685511906.300162 [230] HelloWorld: config: Domain/Internal/DeliveryQueueMaxSamples/#text: 256 {}
1685511906.300179 [230] HelloWorld: config: Domain/Internal/PrimaryReorderMaxSamples/#text: 128 {}
1685511906.300196 [230] HelloWorld: config: Domain/Internal/SecondaryReorderMaxSamples/#text: 128 {}
1685511906.300213 [230] HelloWorld: config: Domain/Internal/DefragUnreliableMaxSamples/#text: 4 {}
1685511906.300230 [230] HelloWorld: config: Domain/Internal/DefragReliableMaxSamples/#text: 16 {}
1685511906.300248 [230] HelloWorld: config: Domain/Internal/BuiltinEndpointSet/#text: writers {}
1685511906.300264 [230] HelloWorld: config: Domain/Internal/MeasureHbToAckLatency/#text: false {}
1685511906.300281 [230] HelloWorld: config: Domain/Internal/UnicastResponseToSPDPMessages/#text: true {}
1685511906.300300 [230] HelloWorld: config: Domain/Internal/SynchronousDeliveryPriorityThreshold/#text: 0 {}
1685511906.300316 [230] HelloWorld: config: Domain/Internal/SynchronousDeliveryLatencyBound/#text: inf {}
1685511906.300333 [230] HelloWorld: config: Domain/Internal/MaxParticipants/#text: 0 {}
1685511906.300351 [230] HelloWorld: config: Domain/Internal/AccelerateRexmitBlockSize/#text: 0 {}
1685511906.300367 [230] HelloWorld: config: Domain/Internal/RetransmitMerging/#text: never {}
1685511906.300385 [230] HelloWorld: config: Domain/Internal/RetransmitMergingPeriod/#text: 5 ms {}
1685511906.300403 [230] HelloWorld: config: Domain/Internal/HeartbeatInterval/#text: 100 ms {}
1685511906.300421 [230] HelloWorld: config: Domain/Internal/HeartbeatInterval[@min]: 5 ms {}
1685511906.300439 [230] HelloWorld: config: Domain/Internal/HeartbeatInterval[@minsched]: 20 ms {}
1685511906.300457 [230] HelloWorld: config: Domain/Internal/HeartbeatInterval[@max]: 8 s {}
1685511906.300475 [230] HelloWorld: config: Domain/Internal/MaxQueuedRexmitBytes/#text: 512 KiB {}
1685511906.300492 [230] HelloWorld: config: Domain/Internal/MaxQueuedRexmitMessages/#text: 200 {}
1685511906.300510 [230] HelloWorld: config: Domain/Internal/WriterLingerDuration/#text: 1 s {}
1685511906.300529 [230] HelloWorld: config: Domain/Internal/SocketReceiveBufferSize[@min]: default {}
1685511906.300547 [230] HelloWorld: config: Domain/Internal/SocketReceiveBufferSize[@max]: default {}
1685511906.300569 [230] HelloWorld: config: Domain/Internal/SocketSendBufferSize[@min]: 64 KiB {}
1685511906.300584 [230] HelloWorld: config: Domain/Internal/SocketSendBufferSize[@max]: default {}
1685511906.300603 [230] HelloWorld: config: Domain/Internal/NackDelay/#text: 100 ms {}
1685511906.300621 [230] HelloWorld: config: Domain/Internal/AckDelay/#text: 10 ms {}
1685511906.300638 [230] HelloWorld: config: Domain/Internal/AutoReschedNackDelay/#text: 3 s {}
1685511906.300655 [230] HelloWorld: config: Domain/Internal/PreEmptiveAckDelay/#text: 10 ms {}
1685511906.300675 [230] HelloWorld: config: Domain/Internal/SquashParticipants/#text: false {}
1685511906.300698 [230] HelloWorld: config: Domain/Internal/SPDPResponseMaxDelay/#text: 0 s {}
1685511906.300714 [230] HelloWorld: config: Domain/Internal/LateAckMode/#text: false {}
1685511906.300731 [230] HelloWorld: config: Domain/Internal/RetryOnRejectBestEffort/#text: false {}
1685511906.300749 [230] HelloWorld: config: Domain/Internal/GenerateKeyhash/#text: false {}
1685511906.300767 [230] HelloWorld: config: Domain/Internal/MaxSampleSize/#text: 2147483647 B {}
1685511906.300783 [230] HelloWorld: config: Domain/Internal/LivelinessMonitoring/#text: false {}
1685511906.300802 [230] HelloWorld: config: Domain/Internal/LivelinessMonitoring[@StackTraces]: true {}
1685511906.300820 [230] HelloWorld: config: Domain/Internal/LivelinessMonitoring[@Interval]: 1 s {}
1685511906.300838 [230] HelloWorld: config: Domain/Internal/MonitorPort/#text: -1 {}
1685511906.300854 [230] HelloWorld: config: Domain/Internal/PrioritizeRetransmit/#text: true {}
1685511906.300875 [230] HelloWorld: config: Domain/Internal/UseMulticastIfMreqn/#text: 0 {}
1685511906.300892 [230] HelloWorld: config: Domain/Internal/RediscoveryBlacklistDuration/#text: 0 s {}
1685511906.300908 [230] HelloWorld: config: Domain/Internal/RediscoveryBlacklistDuration[@enforce]: false {}
1685511906.300926 [230] HelloWorld: config: Domain/Internal/MultipleReceiveThreads/#text: default {}
1685511906.300943 [230] HelloWorld: config: Domain/Internal/MultipleReceiveThreads[@maxretries]: 4294967295 {}
1685511906.300967 [230] HelloWorld: config: Domain/Internal/Test/XmitLossiness/#text: 0 {}
1685511906.300989 [230] HelloWorld: config: Domain/Internal/Watermarks/WhcLow/#text: 1 KiB {}
1685511906.301007 [230] HelloWorld: config: Domain/Internal/Watermarks/WhcHigh/#text: 500 KiB {}
1685511906.301023 [230] HelloWorld: config: Domain/Internal/Watermarks/WhcHighInit/#text: 30 KiB {}
1685511906.301041 [230] HelloWorld: config: Domain/Internal/Watermarks/WhcAdaptive/#text: true {}
1685511906.301062 [230] HelloWorld: config: Domain/Internal/BurstSize/MaxRexmit/#text: 1 MiB {}
1685511906.301079 [230] HelloWorld: config: Domain/Internal/BurstSize/MaxInitTransmit/#text: 4294967295 {}
1685511906.301097 [230] HelloWorld: config: Domain/Internal/EnableExpensiveChecks/#text:  [ignored] {}
1685511906.301116 [230] HelloWorld: config: Domain/TCP/NoDelay/#text: true {}
1685511906.301133 [230] HelloWorld: config: Domain/TCP/Port/#text: -1 {}
1685511906.301172 [230] HelloWorld: config: Domain/TCP/ReadTimeout/#text: 2 s {}
1685511906.301191 [230] HelloWorld: config: Domain/TCP/WriteTimeout/#text: 2 s {}
1685511906.301207 [230] HelloWorld: config: Domain/TCP/AlwaysUsePeeraddrForUnicast/#text: false {}
1685511906.301227 [230] HelloWorld: config: Domain/SSL/Enable/#text: false {}
1685511906.301243 [230] HelloWorld: config: Domain/SSL/CertificateVerification/#text: true {}
1685511906.301261 [230] HelloWorld: config: Domain/SSL/VerifyClient/#text: true {}
1685511906.301278 [230] HelloWorld: config: Domain/SSL/SelfSignedCertificates/#text: false {}
1685511906.301295 [230] HelloWorld: config: Domain/SSL/KeystoreFile/#text: keystore {}
1685511906.301312 [230] HelloWorld: config: Domain/SSL/KeyPassphrase/#text: secret {}
1685511906.301330 [230] HelloWorld: config: Domain/SSL/Ciphers/#text: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH {}
1685511906.301347 [230] HelloWorld: config: Domain/SSL/EntropyFile/#text:  {}
1685511906.301365 [230] HelloWorld: config: Domain/SSL/MinimumTLSVersion/#text: 1.3 {}
1685511906.301381 [230] HelloWorld: config: Domain[@Id]: 230 {0}
1685511906.301426 [230] HelloWorld: started at 1685511906.06301409 -- 2023-05-31 15:45:06+10:00
1685511906.301438 [230] HelloWorld: udp initialized
1685511906.302046 [230] HelloWorld: interfaces: lo udp/127.0.0.1(q1) eno1 udp/131.181.33.121(q9) docker0 udp/172.17.0.1(q9)
1685511906.302073 [230] HelloWorld: selected interfaces: lo (index 1 priority 2)
1685511906.302086 [230] HelloWorld: selected interface "lo" is not multicast-capable: disabling multicast
1685511906.302086 [230] HelloWorld: selected interface "lo" is not multicast-capable: disabling multicast
1685511906.302123 [230] HelloWorld: ownip: udp/127.0.0.1
1685511906.302135 [230] HelloWorld: extmask: invalid/0 (not applicable)
1685511906.302149 [230] HelloWorld: SPDP MC: udp/239.255.0.1
1685511906.302163 [230] HelloWorld: default MC: udp/239.255.0.1
1685511906.302174 [230] HelloWorld: SSM support included
1685511906.302462 [230] HelloWorld: rtps_init: trying to find a free participant index
1685511906.302506 [230] HelloWorld: socket receive buffer size set to 2097152 bytes
1685511906.302540 [230] HelloWorld: socket receive buffer size set to 2097152 bytes
1685511906.302559 [230] HelloWorld: rtps_init: uc ports: disc 64910 data 64911
1685511906.302572 [230] HelloWorld: rtps_init: domainid 230 participantid 1
1685511906.302585 [230] HelloWorld: Unicast Ports: discovery 64910 data 64911
1685511906.302610 [230] HelloWorld: socket receive buffer size set to 2097152 bytes
1685511906.302632 [230] HelloWorld: interface lo: transmit port 47216
1685511906.302674 [230] HelloWorld: add_peer_addresses: add udp/127.0.0.1:64910, :64912, :64914, :64916, :64918, :64920, :64922, :64924, :64926
eboasson commented 1 year ago

That's weird. The output in the trace is entirely consistent with using domain id 230, and when I tried it (ddsperf -i 230 sanity as well as with a small Python script) it all worked as expected.

What I am wondering is if in your case perhaps different Cyclone traces are overwriting each other. It is easy to get the process id in the file name:

<Tracing>
  <OutputFile>cdds.log.${CYCLONEDDS_PID}</OutputFile>
</Tracing>

If you also have multiple domains in a single process,

<Tracing>
  <OutputFile>cdds.log.${CYCLONEDDS_DOMAIN_ID}.${CYCLONEDDS_PID}</OutputFile>
</Tracing>

will do the trick.

That is, as long as CYCLONEDDS_PID and CYCLONEDDS_DOMAIN_ID are not defined as environment variables, because if the environment defines them, they take precedence.

jc211 commented 1 year ago

I think this is exactly the problem. I was creating 2 domains, one for the subscriber and one for the publisher in the same program for testing purposes and I think one overwrote the other in some way. Thank you :+1: