Code Monkey home page Code Monkey logo

cyclonedds's Introduction

GitHub release Build Status Coverity Status Coverage License License Website Community

Eclipse Cyclone DDS

Eclipse Cyclone DDS is a very performant and robust open-source implementation of the OMG DDS specification. Cyclone DDS is developed completely in the open as an Eclipse IoT project (see eclipse-cyclone-dds) with a growing list of adopters (if you're one of them, please add your logo). It is a tier-1 middleware for the Robot Operating System ROS 2.

What is DDS?

DDS is the best-kept secret in distributed systems, one that has been around for much longer than most publish-subscribe messaging systems and still outclasses so many of them. DDS is used in a wide variety of systems, including air-traffic control, jet engine testing, railway control, medical systems, naval command-and-control, smart greenhouses and much more. In short, it is well-established in aerospace and defense but no longer limited to that. And yet it is easy to use!

Types are usually defined in IDL and preprocessed with the IDL compiler included in Cyclone, but our Python binding allows you to define data types on the fly:

from dataclasses import dataclass
from cyclonedds.domain import DomainParticipant
from cyclonedds.core import Qos, Policy
from cyclonedds.pub import DataWriter
from cyclonedds.sub import DataReader
from cyclonedds.topic import Topic
from cyclonedds.idl import IdlStruct
from cyclonedds.idl.annotations import key
from time import sleep
import numpy as np
try:
    from names import get_full_name
    name = get_full_name()
except:
    import os
    name = f"{os.getpid()}"

# C, C++ require using IDL, Python doesn't
@dataclass
class Chatter(IdlStruct, typename="Chatter"):
    name: str
    key("name")
    message: str
    count: int

rng = np.random.default_rng()
dp = DomainParticipant()
tp = Topic(dp, "Hello", Chatter, qos=Qos(Policy.Reliability.Reliable(0)))
dw = DataWriter(dp, tp)
dr = DataReader(dp, tp)
count = 0
while True:
    sample = Chatter(name=name, message="Hello, World!", count=count)
    count = count + 1
    print("Writing ", sample)
    dw.write(sample)
    for sample in dr.take(10):
        print("Read ", sample)
    sleep(rng.exponential())

Today DDS is also popular in robotics and autonomous vehicles because those really depend on high-throughput, low-latency control systems without introducing a single point of failure by having a message broker in the middle. Indeed, it is by far the most used and the default middleware choice in ROS 2. It is used to transfer commands, sensor data and even video and point clouds between components.

The OMG DDS specifications cover everything one needs to build systems using publish-subscribe messaging. They define a structural type system that allows automatic endianness conversion and type checking between readers and writers. This type system also supports type evolution. The interoperable networking protocol and standard C++ API make it easy to build systems that integrate multiple DDS implementations. Zero-configuration discovery is also included in the standard and supported by all implementations.

DDS actually brings more: publish-subscribe messaging is a nice abstraction over "ordinary" networking, but plain publish-subscribe doesn't affect how one thinks about systems. A very powerful architecture that truly changes the perspective on distributed systems is that of the "shared data space", in itself an old idea, and really just a distributed database. Most shared data space designs have failed miserably in real-time control systems because they provided strong consistency guarantees and sacrificed too much performance and flexibility. The eventually consistent shared data space of DDS has been very successful in helping with building systems that need to satisfy many "ilities": dependability, maintainability, extensibility, upgradeability, ... Truth be told, that's why it was invented, and publish-subscribe messaging was simply an implementation technique.

Cyclone DDS aims at full coverage of the specs and today already covers most of this. With references to the individual OMG specifications, the following is available:

  • DCPS the base specification
    • zero configuration discovery (if multicast works)
    • publish/subscribe messaging
    • configurable storage of data in subscribers
    • many QoS settings - liveliness monitoring, deadlines, historical data, ...
    • coverage includes the Minimum, Ownership and (partially) Content profiles
  • DDS Security - providing authentication, access control and encryption
  • DDS C++ API
  • DDS XTypes - the structural type system (some caveats here)
  • DDSI-RTPS - the interoperable network protocol

The network stack in Cyclone DDS has been around for over a decade in one form or another and has proven itself in many systems, including large, high-availability ones and systems where interoperatibility with other implementations was needed.

This repository provides the core of Cyclone DDS including its C API, the OMG C++ and the Python language bindings are in sibling repositories.

Consult the roadmap for a high-level overview of upcoming features.

Getting Started

Building Eclipse Cyclone DDS

In order to build Cyclone DDS you need a Linux, Mac or Windows 10 machine (or, with some caveats, a *BSD, QNX, OpenIndiana or a Solaris 2.6 one) with the following installed on your host:

  • C compiler (most commonly GCC on Linux, Visual Studio on Windows, Xcode on macOS);
  • Optionally GIT version control system;
  • CMake, version 3.16 or later;
  • Optionally OpenSSL, we recommend a fully patched and supported version but 1.1.1 will still work;
  • Optionally Eclipse Iceoryx version 2.0 for shared memory and zero-copy support;
  • Optionally Bison parser generator. A cached source is checked into the repository.

If you want to play around with the parser you will need to install the bison parser generator. On Ubuntu apt install bison should do the trick for getting it installed. On Windows, installing chocolatey and choco install winflexbison3 should get you a long way. On macOS, brew install bison is easiest.

To obtain Eclipse Cyclone DDS, do

$ git clone https://github.com/eclipse-cyclonedds/cyclonedds.git
$ cd cyclonedds
$ mkdir build

Depending on whether you want to develop applications using Cyclone DDS or contribute to it you can follow different procedures:

Build configuration

There are some configuration options specified using CMake defines in addition to the standard options like CMAKE_BUILD_TYPE:

  • -DBUILD_EXAMPLES=ON: to build the included examples
  • -DBUILD_TESTING=ON: to build the test suite (forces exporting all symbols from the library)
  • -DBUILD_IDLC=NO: to disable building the IDL compiler (affects building examples, tests and ddsperf)
  • -DBUILD_DDSPERF=NO: to disable building the ddsperf tool for performance measurement
  • -DENABLE_SSL=NO: to not look for OpenSSL, remove TLS/TCP support and avoid building the plugins that implement authentication and encryption (default is AUTO to enable them if OpenSSL is found)
  • -DENABLE_ICEORYX=NO: do not look for Iceoryx disable building the PSMX Iceoryx plugin (default is AUTO to enable it if Iceoryx is found)
  • -DENABLE_SECURITY=NO: to not build the security interfaces and hooks in the core code, nor the plugins (one can enable security without OpenSSL present, you'll just have to find plugins elsewhere in that case)
  • -DENABLE_LIFESPAN=NO: to exclude support for finite lifespans QoS
  • -DENABLE_DEADLINE_MISSED=NO: to exclude support for finite deadline QoS settings
  • -DENABLE_TYPELIB=NO: to exclude support for type library, requires also disabling type and topic discovery using -DENABLE_TYPE_DISCOVERY=NO and -DENABLE_TOPIC_DISCOVERY=NO
  • -DENABLE_TYPE_DISCOVERY=NO: to exclude support for type discovery and checking type compatibility (effectively most of XTypes), requires also disabling topic discovery using -DENABLE_TOPIC_DISCOVERY=NO
  • -DENABLE_TOPIC_DISCOVERY=NO: to exclude support for topic discovery
  • -DENABLE_SOURCE_SPECIFIC_MULTICAST=NO: to disable support for source-specific multicast (disabling this and -DENABLE_IPV6=NO may be needed for QNX builds)
  • -DENABLE_IPV6=NO: to disable ipv6 support (disabling this and -DENABLE_SOURCE_SPECIFIC_MULTICAST=NO may be needed for QNX builds)
  • -DBUILD_IDLC_XTESTS=NO: Include a set of tests for the IDL compiler that use the C back-end to compile an idl file at (test) runtime, and use the C compiler to build a test application for the generated types, that is executed to do the actual testing (not supported on Windows)
  • -DENABLE_QOS_PROVIDER=NO: to disable support for qos provider

For application developers

To build and install the required libraries needed to develop your own applications using Cyclone DDS requires a few simple steps. There are some small differences between Linux and macOS on the one hand, and Windows on the other. For Linux or macOS:

$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake --build .

and for Windows:

$ cd build
$ cmake -G "<generator-name>" -DCMAKE_INSTALL_PREFIX=<install-location> ..
$ cmake --build .

where you should replace <install-location> by the directory under which you would like to install Cyclone DDS and <generator-name> by one of the ways CMake generators offer for generating build files. For example, "Visual Studio 15 2017 Win64" would target a 64-bit build using Visual Studio 2017.

To install it after a successful build, do:

$ cmake --build . --target install

which will copy everything to:

  • <install-location>/lib
  • <install-location>/bin
  • <install-location>/include/ddsc
  • <install-location>/share/CycloneDDS

Depending on the installation location you may need administrator privileges.

At this point you are ready to use Eclipse Cyclone DDS in your own projects.

Note that the default build type is a release build with debug information included (RelWithDebInfo), which is generally the most convenient type of build to use from applications because of a good mix between performance and still being able to debug things. If you'd rather have a Debug or pure Release build, set CMAKE_BUILD_TYPE accordingly.

Contributing to Eclipse Cyclone DDS

We very much welcome all contributions to the project, whether that is questions, examples, bug fixes, enhancements or improvements to the documentation, or anything else really. When considering contributing code, it might be good to know that build configurations for Azure pipelines are present in the repository and that there is a test suite built using a simple testing framework and CTest that can be built locally if desired. To build it, set the cmake variable BUILD_TESTING to on when configuring, e.g.:

$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ..
$ cmake --build .
$ ctest

Documentation

The documentation is still rather limited and some parts of it are still only available in the form of text files in the docs directory. This README is usually out-of-date and the state of the documentation is slowly improving, so it definitely worth hopping over to have a look.

Building and Running the Roundtrip Example

We will show you how to build and run an example program that measures latency. The examples are built automatically when you build Cyclone DDS, so you don't need to follow these steps to be able to run the program, it is merely to illustrate the process.

$ mkdir roundtrip
$ cd roundtrip
$ cmake <install-location>/share/CycloneDDS/examples/roundtrip
$ cmake --build .

On one terminal start the application that will be responding to pings:

$ ./RoundtripPong

On another terminal, start the application that will be sending the pings:

$ ./RoundtripPing 0 0 0
# payloadSize: 0 | numSamples: 0 | timeOut: 0
# Waiting for startup jitter to stabilise
# Warm up complete.
# Latency measurements (in us)
#             Latency [us]                                   Write-access time [us]       Read-access time [us]
# Seconds     Count   median      min      99%      max      Count   median      min      Count   median      min
    1     28065       17       16       23       87      28065        8        6      28065        1        0
    2     28115       17       16       23       46      28115        8        6      28115        1        0
    3     28381       17       16       22       46      28381        8        6      28381        1        0
    4     27928       17       16       24      127      27928        8        6      27928        1        0
    5     28427       17       16       20       47      28427        8        6      28427        1        0
    6     27685       17       16       26       51      27685        8        6      27685        1        0
    7     28391       17       16       23       47      28391        8        6      28391        1        0
    8     27938       17       16       24       63      27938        8        6      27938        1        0
    9     28242       17       16       24      132      28242        8        6      28242        1        0
   10     28075       17       16       23       46      28075        8        6      28075        1        0

The numbers above were measured on Mac running a 4.2 GHz Intel Core i7 on December 12th 2018. From these numbers you can see how the roundtrip is very stable and the minimal latency is now down to 17 micro-seconds (used to be 25 micro-seconds) on this HW.

Performance

Reliable message throughput is over 1MS/s for very small samples and is roughly 90% of GbE with 100 byte samples, and latency is about 30us when measured using ddsperf between two Intel(R) Xeon(R) CPU E3-1270 V2 @ 3.50GHz (that's 2012 hardware ...) running Ubuntu 16.04, with the executables built on Ubuntu 18.04 using gcc 7.4.0 for a default (i.e., "RelWithDebInfo") build.

ThroughputThroughput

This is with the subscriber in listener mode, using asynchronous delivery for the throughput test. The configuration is a marginally tweaked out-of-the-box configuration: an increased maximum message size and fragment size, and an increased high-water mark for the reliability window on the writer side. For details, see the scripts directory, the environment details and the throughput and latency data underlying the graphs. These also include CPU usage (throughput and latency) and memory usage.

Run-time configuration

The out-of-the-box configuration should usually be fine, but there are a great many options that can be tweaked by creating an XML file with the desired settings and defining the CYCLONEDDS_URI to point to it. E.g. (on Linux):

$ cat cyclonedds.xml
<?xml version="1.0" encoding="UTF-8" ?>
<CycloneDDS xmlns="https://cdds.io/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://cdds.io/config https://raw.githubusercontent.com/eclipse-cyclonedds/cyclonedds/master/etc/cyclonedds.xsd">
    <Domain Id="any">
        <General>
            <Interfaces>
                <NetworkInterface autodetermine="true" priority="default" multicast="default" />
            </Interfaces>
            <AllowMulticast>default</AllowMulticast>
            <MaxMessageSize>65500B</MaxMessageSize>
        </General>
        <Discovery>
            <EnableTopicDiscoveryEndpoints>true</EnableTopicDiscoveryEndpoints>
        </Discovery>
        <Internal>
            <Watermarks>
                <WhcHigh>500kB</WhcHigh>
            </Watermarks>
        </Internal>
        <Tracing>
            <Verbosity>config</Verbosity>
            <OutputFile>cdds.log.${CYCLONEDDS_PID}</OutputFile>
        </Tracing>
    </Domain>
</CycloneDDS>
$ export CYCLONEDDS_URI=file://$PWD/cyclonedds.xml

(on Windows, one would have to use set CYCLONEDDS_URI=file://... instead.)

This example shows a few things:

  • Interfaces can be used to override the interfaces selected by default. Members are
    • NetworkInterface[@autodetermine] tells Cyclone DDS to autoselect the interface it deems best.
    • NetworkInterface[@name] specifies the name of an interface to select (not shown above, alternative for autodetermine).
    • NetworkInterface[@address] specifies the ipv4/ipv6 address of an interface to select (not shown above, alternative for autodetermine).
    • NetworkInterface[@multicast] specifies whether multicast should be used on this interface. The default value 'default' means Cyclone DDS will check the OS reported flags of the interface and enable multicast if it is supported. Use 'true' to ignore what the OS reports and enable it anyway and 'false' to always disable multicast on this interface.
    • NetworkInterface[@priority] specifies the priority of an interface. The default value (default) means priority 0 for normal interfaces and 2 for loopback interfaces.
  • AllowMulticast configures the circumstances under which multicast will be used. If the selected interface doesn't support it, it obviously won't be used (false); but if it does support it, the type of the network adapter determines the default value. For a wired network, it will use multicast for initial discovery as well as for data when there are multiple peers that the data needs to go to (true). On a WiFi network it will use it only for initial discovery (spdp), because multicast on WiFi is very unreliable.
  • EnableTopicDiscoveryEndpoints turns on topic discovery (assuming it is enabled at compile time), it is disabled by default because it isn't used in many system and comes with a significant amount of overhead in discovery traffic.
  • Verbosity allows control over the tracing, "config" dumps the configuration to the trace output (which defaults to "cyclonedds.log", but here the process id is appended). Which interface is used, what multicast settings are used, etc., is all in the trace. Setting the verbosity to "finest" gives way more output on the inner workings, and there are various other levels as well.
  • MaxMessageSize controls the maximum size of the RTPS messages (basically the size of the UDP payload). Large values such as these typically improve performance over the (current) default values on a loopback interface.
  • WhcHigh determines when the sender will wait for acknowledgements from the readers because it has buffered too much unacknowledged data. There is some auto-tuning, the (current) default value is a bit small to get really high throughput.

Background information on configuring Cyclone DDS can be found here and a list of settings is available.

Trademarks

  • "Eclipse Cyclone DDS", "Cyclone DDS", "Eclipse Iceoryx" and "Iceoryx" are trademarks of the Eclipse Foundation.
  • "DDS" is a trademark of the Object Management Group, Inc.
  • "ROS" is a trademark of Open Source Robotics Foundation, Inc.

cyclonedds's People

Contributors

clalancette avatar cottsay avatar dkroenke avatar dpotman avatar e-hndrks avatar eboasson avatar ettorevidotto avatar evshary avatar firassahliadlinktech avatar fransfaase avatar k0ekk0ek avatar kurtuluso avatar marceljordense avatar martinbremmer avatar matthiaskillat avatar mvandenhoek avatar noxpardalis avatar patrickm-zs avatar petercadogan avatar poetinger avatar reicheratwork avatar robertfemmer avatar roehling avatar rotu avatar splinter1984 avatar stefansli avatar sumanth-nirmal avatar thijsmie avatar thijssassen avatar trittsv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cyclonedds's Issues

Deadlock between writing data and a publication matched notification

There is a deadly embrace between the DDSI writer's lock and the DCPS entity lock, at least when signalling that a matching subscriber no longer exists while the writer is writing a sample. Presumably the same can happen when a new subscriber shows up, and perhaps for some other notifications as well.

    2731 Thread_144215   DispatchQueue_1: com.apple.main-thread  (serial)
    + 2731 start  (in libdyld.dylib) + 1  [0x7fff6fc78085]
    +   2731 main  (in ThroughputPublisher) + 381  [0x104c0500d]  publisher.c:94
    +     2731 start_writing  (in ThroughputPublisher) + 154  [0x104c0552a]  publisher.c:244
    +       2731 dds_write  (in libddsc.0.dylib) + 103  [0x104c9aef7]  dds_write.c:44
    +         2731 dds_write_impl  (in libddsc.0.dylib) + 653  [0x104c9b28d]  dds_write.c:224
    +           2731 write_sample_gc  (in libddsc.0.dylib) + 79  [0x104c68aaf]  q_transmit.c:1140
    +             2731 write_sample_eot  (in libddsc.0.dylib) + 750  [0x104c68dae]  q_transmit.c:1028
    +               2731 os_mutexLock  (in libddsc.0.dylib) + 85  [0x104cb4085]  os_platform_sync.c:123
    +                 2731 _pthread_mutex_firstfit_lock_slow  (in libsystem_pthread.dylib) + 226  [0x7fff6fe684c7]
    +                   2731 _pthread_mutex_firstfit_lock_wait  (in libsystem_pthread.dylib) + 96  [0x7fff6fe6ada0]
    +                     2731 __psynch_mutexwait  (in libsystem_kernel.dylib) + 10  [0x7fff6fdb3872]

and

    + 2731 thread_start  (in libsystem_pthread.dylib) + 13  [0x7fff6fe69425]
    +   2731 _pthread_start  (in libsystem_pthread.dylib) + 70  [0x7fff6fe6d2a7]
    +     2731 _pthread_body  (in libsystem_pthread.dylib) + 126  [0x7fff6fe6a33d]
    +       2731 os_startRoutineWrapper  (in libddsc.0.dylib) + 170  [0x104cb552a]  os_posix_thread.c:176
    +         2731 create_thread_wrapper  (in libddsc.0.dylib) + 62  [0x104c661ce]  q_thread.c:179
    +           2731 gcreq_queue_thread  (in libddsc.0.dylib) + 856  [0x104c34bb8]  q_gc.c:156
    +             2731 gc_delete_proxy_reader  (in libddsc.0.dylib) + 231  [0x104c337f7]  q_entity.c:4351
    +               2731 writer_drop_connection  (in libddsc.0.dylib) + 284  [0x104c3394c]  q_entity.c:1314
    +                 2731 dds_writer_status_cb  (in libddsc.0.dylib) + 90  [0x104c7b67a]  dds_writer.c:80
    +                   2731 dds_entity_lock  (in libddsc.0.dylib) + 151  [0x104c89af7]  dds_entity.c:1034
    +                     2731 os_mutexLock  (in libddsc.0.dylib) + 85  [0x104cb4085]  os_platform_sync.c:123
    +                       2731 _pthread_mutex_firstfit_lock_slow  (in libsystem_pthread.dylib) + 226  [0x7fff6fe684c7]
    +                         2731 _pthread_mutex_firstfit_lock_wait  (in libsystem_pthread.dylib) + 96  [0x7fff6fe6ada0]
    +                           2731 __psynch_mutexwait  (in libsystem_kernel.dylib) + 10  [0x7fff6fdb3872]

How do use Cyclone DDS on Windows?

Hi,

I was trying to do the build/install and then use Cyclone DDS on windows (using Visual Studio). I was able to configure cmake with the Visual Studio 15 2017 generator and call
cmake --build . --config Release --target install with admin rights from the build dir to install the CycloneDDS module. So far so good. Although it would be nice if the build steps for Windows / Visual Studio would be documented as well.

The actual problem I now am stuck with is, that the headers do not seem to be found when trying to use an example project. I copied the "helloworld" example project to a different location and just tried to configure and build it. Configuring the build with the Visual Studio 15 2017 generator works, but actually building the project fails, because the ddsc headers cannot be resolved. Is there an INCLUDE_DIRS variable I can use or something?

I've uploaded the test project here:
https://github.com/Boereck/cyclone-dds-test
If you run the init.ps1 powershell script on windows you should see that the last build step fails.

Thanks!

Assertion on dispose instance

Hi all,

Using Cyclone DDS through the dstore
I got an assertion error when closing the store.

python3: /home/pi/atolab/cyclone/cdds/src/util/src/ut_handleserver.c:272: ut_handle_release: Assertion `hs' failed.

This simple code reproduce the error

from dstore import Store
s = Store('one','r','r/h',100)
s.close()

I also had some gdb diligence:

__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) up
#1  0x76d7c824 in __GI_abort () at abort.c:89
89	abort.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x76d7c824 in __GI_abort () at abort.c:89
#2  0x76d741a4 in __assert_fail_base (fmt=0x757ff470 "\001", assertion=0x76236eb8 "hs", 
    assertion@entry=0x2 <error: Cannot access memory at address 0x2>, file=0x757fec0c " ", file@entry=0x76e8c078 <lock> "", line=272, 
    line@entry=1971319920, function=function@entry=0x76237020 <__PRETTY_FUNCTION__.9463> "ut_handle_release") at assert.c:92
#3  0x76d74280 in __GI___assert_fail (assertion=0x2 <error: Cannot access memory at address 0x2>, file=0x76e8c078 <lock> "", line=1971319920, 
    function=0x76237020 <__PRETTY_FUNCTION__.9463> "ut_handle_release") at assert.c:101
#4  0x7620217c in ut_handle_release () from /usr/local/lib/libddsc.so
#5  0x761d99ec in dds_writer_status_cb () from /usr/local/lib/libddsc.so
#6  0x7618c04c in gc_delete_writer () from /usr/local/lib/libddsc.so
#7  0x76191db0 in gcreq_queue_thread () from /usr/local/lib/libddsc.so
#8  0x761c1394 in create_thread_wrapper () from /usr/local/lib/libddsc.so
#9  0x7620fbfc in os_startRoutineWrapper () from /usr/local/lib/libddsc.so
#10 0x76f94fc4 in start_thread (arg=0x757ff470) at pthread_create.c:335
#11 0x76e20bc8 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:76 from /lib/arm-linux-gnueabihf/libc.so.6

Need more info?

Some questions about ddsi

Hello,
I've been reading the source code of Cyclone recently. I have also read the ddsi-rtps (i will call it rtps for convenience) specification and compared it with ddsi in Cyclone. I find that ddsi is different from rtps specification. For example, I haven't found History Cache in ddsi which is important in rtps. And the interface for ddsi also seems different with rtps. How can I code upon ddsi if I want to add some functions in ddsc?
Thanks!

No "*.cyclonedds.compilers.Idlc" found under the command "make datatype"

By reading the document "VortexDDS Release 0.1.0", I tried to translate "HelloWorldData.idl" into "HelloWorldData.c" and "HelloWorldData.h" with the command “make datatype” in the directory "/examples/helloworld". However, error came with the msg "Could not find or load main class org.eclipse.cyclonedds.compilers.Idlc". Where can I get this ".Idlc". Thx!

Hi. I want to ignore a participant.

Hi. I want to ignore a participant. I wonder where I can create an ignoreList and update it during the interaction between pubs and subs? By reading DDS Spec. (2.2.2.2.1.14). I found it as an irreversible operation. I hope that you can give me some implementation ideas.

API Organisation for Languages other than C

Dear all, I'd like to discuss the matter of APIs -- other than C -- organisation in cyclone DDS. My proposal is to ensure that API are external repository that have dependencies from the cyclone library.

From my perspective the advantage of keeping the API separated from cyclone core are manyfold. Some of the most relevant being (1) we keep cyclones base small and with minimal set of external dependencies -- BTW, would be good to remove the dependency on JDK to build it; (2) We can more easily have people contribute and experiment with new API; and (3) we can have different level of maturity for APIs and core.

We should also define some guidelines to follow for those that want to implement a new language bindings.

Finally, I'd like to hear from the community what'd their needs would be.

@kydos

HISTORY QoS Problem

Hi,
In my expriment, I want to test HISTORY QoS, but when I test, it seems not work as I want.
Here is the description of HISTORY QoS in OMG specification.

If the kind is set to KEEP_ALL, then the Service will attempt to maintain and deliver all the values of the instance to existing subscribers. The resources that the Service can use to keep this history are limited by the settings of the RESOURCE_LIMITS QoS. If the limit is reached, then the behavior of the Service will depend on the RELIABILITY QoS. If the reliability kind is BEST_EFFORT, then the old values will be discarded. If reliability is RELIABLE, then the Service will block the DataWriter until it can deliver the necessary old values to all subscribers.

So I set the datawriter QoS as belows and change helloworld examples

#dw qos
    dwQos = dds_qos_create ();
    dds_qset_reliability (dwQos, DDS_RELIABILITY_RELIABLE, DDS_INFINITY);
    dds_qset_history (dwQos, DDS_HISTORY_KEEP_ALL, 0);
    dds_qset_resource_limits (dwQos, 100, DDS_LENGTH_UNLIMITED, DDS_LENGTH_UNLIMITED);
#my idl
	module HelloWorldData
	{
	  struct Msg
	  {
	    long userID;
	    string message;
	  };
	  #pragma keylist Msg userID
	};
#my write opretion
    msg.userID = 1;
    char s;
    printf ("=== [Publisher]  Writing : ");
    for (int i=0;i<50;i++)
    {
        s = (char)i;
        msg.message = &s;
        ret = dds_write (writer, &msg);
        DDS_ERR_CHECK (ret, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
        printf ("Message (%d, %d)\n", msg.userID, *msg.message);
        dds_sleepfor (DDS_MSECS (1000));
    }

As I think, all the msgs I write belongs to the same instance, so all the samples will be saved until all the samples are received by the subscriber's reader.
And I do expriment as belows:
(1)Run two docker containers and bridge to the same network interface---docker0.
(2)container_1 run HelloworldPublisher, then container_2 run HelloworldSubscriber.
(3)container_2 will receive message and till message 20, I use ifconfig docker0 down to turn off the network interface.
(4)container_2 will stop receiving data.
(5)I use ifconfig docker0 up to turn on the networkinterface.
(6)container_2 will start to receive message again, but the message starts from message 28.

So my problem is that container_2 doesn't receive message21-27, but in the specification, it said should receive all.

timestamp resolution on windows

The roundtrip-example, when run on windows displays only zero's for min/mean roundtrip-times.
This is most likely due to using a clock with insufficient resolution

Some problem about DDS_RELIABILITY_BEST_EFFORT(QoS)

Hi,
Recently, I want to know the throughput of dds without losing samples. No matter what parameter I set(at the same host), it always loses samples when I run the Throughput example with DDS_RELIABILITY_BEST_EFFORT QoS setting.

# terminal 1
./ThroughputSubscriber
Cycles: 0 | PollingDelay: 0 | Partition: Throughput example
=== [Subscriber] Waiting for samples...
=== [Subscriber] Payload size: 4000 | Total received: 2 samples, 8016 bytes | Out of order: 0 samples Transfer rate: 0.00 samples/s, 0.00 Mbit/s
=== [Subscriber] Payload size: 4000 | Total received: 503 samples, 2016024 bytes | Out of order: 0 samples Transfer rate: 497.05 samples/s, 14.94 Mbit/s
=== [Subscriber] Payload size: 4000 | Total received: 1004 samples, 4024032 bytes | Out of order: 0 samples Transfer rate: 496.97 samples/s, 14.94 Mbit/s
=== [Subscriber] Payload size: 4000 | Total received: 1504 samples, 6028032 bytes | Out of order: 0 samples Transfer rate: 496.07 samples/s, 14.94 Mbit/s
=== [Subscriber] Payload size: 4000 | Total received: 2002 samples, 8024016 bytes | Out of order: 0 samples Transfer rate: 494.16 samples/s, 14.94 Mbit/s
^C=== [Subscriber] Payload size: 4000 | Total received: 2490 samples, 9979920 bytes | Out of order: 0 samples Transfer rate: 493.90 samples/s, 15.24 Mbit/s

Total received: 2490 samples, 9979920 bytes
Out of order: 0 samples
Average transfer rate: 622.50 samples/s, 19.75 Mbit/s
------------------------------------------------------------------------------
# terminal 2
./ThroughputPublisher 4000 20 10 5
payloadSize: 4000 bytes burstInterval: 20 ms burstSize: 10 timeOut: 5 seconds partitionName: Throughput example

=== [Publisher]  Waiting for a reader ...
=== [Publisher]  Writing samples...
=== [Publisher]  Timed out, 2500 samples written.

In my test, the pub writes 2500 samples but the sub just gets 2490 samples. In my opinion, if the load is lite and the pub/sub are running at same host, it should not lose samples. why does this happen?

Some questions about how to make the size of libddsc.so smaller

Hi, recently, I want to make the size of libddsc.so smaller, because my hardware has very small RAM size, just 3M; and libddsc.so contains all the files in ddsc and the files in ddsi directory, when the example runs, the libddsc.so will be loaded into the RAM, so will take over 1M(I want it smaller than 1M). When I check the /proc/$PID/smap, I get the key information below:

7fab8631b000-7fab8640b000 r-xp 00000000 fd:02 3939856                    cyclonedds/build/lib/libddsc.so.0.1.0
Size:                960 kB
Rss:                 916 kB
Pss:                 480 kB
Shared_Clean:        872 kB
Shared_Dirty:          0 kB
Private_Clean:        44 kB
Private_Dirty:         0 kB
Referenced:          916 kB
Anonymous:             0 kB
AnonHugePages:         0 kB
Shared_Hugetlb:        0 kB
Private_Hugetlb:       0 kB
Swap:                  0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd ex mr mw me 

This lib costs about 916KB, So how can I make libddsc.so smaller to make the example take less RAM?

lookup_thread_state_real bug found

Hi, I found a bug for thread management for user application threads.
Imagine the usecase: the user is creating multiple threads in a for loop.(5 threads created, once they done, 5 new threads created again). In this case, thread id for a new thread may be same with that of an old thread(which is finished by the user application).
However, in Cyclone thread management, the old application thread information will be recorded in the global thread pool.
Function lookup_thread_state:

    if ((ts1 = tsd_thread_state) == NULL) {
        if ((ts1 = lookup_thread_state_real()) == NULL) {
            /* this situation only arises for threads that were not created
               using create_thread, aka application threads. since registering

               thread state should be fully automatic the name will simply be
               the identifier */
            tid = os_threadIdSelf();
            (void)snprintf(
                tname, sizeof(tname), "0x%"PRIxMAX, os_threadIdToInteger(tid));
            os_mutexLock(&thread_states.lock);
            ts1 = init_thread_state(tname);
            if (ts1 != NULL) {
                os_osInit();
                ts1->extTid = tid;
                ts1->tid = tid;   //The old thread information is recorded here!
                DDS_LOG(DDS_LC_INFO, "started application thread %s\n", tname);
                os_threadCleanupPush(&cleanup_thread_state, NULL);
            }
            assert(ts1->state == THREAD_STATE_ALIVE);
            os_mutexUnlock(&thread_states.lock);
        }
        tsd_thread_state = ts1;
    }

When a new thread with the same thread id comes, it will step into lookup_thread_state_real function. It will satisfy os_threadEqual (thread_states.ts[i].tid, tid) condition and return the information about an old thread. Then it will cause two real threads to both acquire one cyclone thread in the pool. This may cause unexpected problems. Can you have a look at it?

struct thread_state1 *lookup_thread_state_real (void)
{
  if (thread_states.ts) {
    os_threadId tid = os_threadIdSelf ();
    unsigned i;
    for (i = 0; i < thread_states.nthreads; i++) {
      if (os_threadEqual (thread_states.ts[i].tid, tid) ) {   //The new thread with the same thread id will satisfy this condition
        return &thread_states.ts[i];  //An old finished thread information can be returned here!
      }
    }
  }
  return NULL;
}

When to release the first version

I want to know when can release the first version of cyclonedds, just like 0.1.0.
It will help us to know what the new features are introduced between two versions, and will be easier to follow this project.
Haha, maybe you already have a plan or a roadmap (like, before the Christmas Day)...

Problem about qos update

Hi,
Recently I am very interested about QoS, and I meet one problem about qos updating. And the source code will not update and not resend new participant qos. Here is my example:

int main(int argc, char **argv) {
  dds_entity_t participant;
  dds_entity_t topic;
  dds_entity_t writer;
  dds_return_t ret;
  (void) argc;
  (void) argv;

  dds_qos_t *qos = dds_qos_create();
  char *x = "hello";
  dds_qset_userdata(qos, (void *) x, 5);

  /* Create a Participant. */
  participant = dds_create_participant(DDS_DOMAIN_DEFAULT, qos, NULL);

  dds_sleepfor(DDS_SECS(5));

  char *y = "yoyol";
  dds_qset_userdata(qos, (void *)y, 5);

  dds_set_qos(participant, qos);


  printf("set done!\n");
  while (true);

}

I check source code and there is too many status variables connected with participant qos, very confused.
And I check and the subscriber will not receive the new qos. So if I want to make it, How can I do this?
(1) How to update qos of publisher's participant.
(2)How does the subscriber receive and update the publisher's participant qos.

Documentation of 'Building Cyclone DDS' incomplete

Hi,

I tried to install CycloneDDS on a clean Kubuntu 18.04 LTS and bumped into a few issues when following the steps in section ' Building Cyclone DDS' (see https://github.com/eclipse/cyclonedds) along the way. I thought it might benefit the project to let you know about these issues so the documentation can be improved.

The issues I bumped into are:

  1. The prerequisites are incomplete. Besides cmake, java and maven you also need git and g++ which are not present on a clean install. They can simply be installed using sudo apt-get install
  2. OpenJDK is by default installed on Ubuntu, but this causes problems. It seems better to use oracle-java, but this is not clear from the instructions. I followed https://www.linuxuprising.com/2018/10/how-to-install-oracle-java-11-in-ubuntu.html
  3. When I tried to ' make' the stuff in the build directory I ran into the following issue
    Scanning dependencies of target idlc [ 0%] Building JAR file /home/lex/Repositories/cyclone/cyclonedds/build/idlc/target/idlc-jar-with-dependencies.jar WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [ERROR] Plugin org.antlr:antlr4-maven-plugin:4.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.antlr:antlr4-maven-plugin:jar:4.5: Could not transfer artifact org.antlr:antlr4-maven-plugin:pom:4.5 from/to central (https://repo.maven.apache.org/maven2): Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException idlc/CMakeFiles/idlc.dir/build.make:183: recipe for target 'idlc/target/idlc-jar-with-dependencies.jar' failed make[2]: *** [idlc/target/idlc-jar-with-dependencies.jar] Error 1 CMakeFiles/Makefile2:85: recipe for target 'idlc/CMakeFiles/idlc.dir/all' failed make[1]: *** [idlc/CMakeFiles/idlc.dir/all] Error 2 Makefile:151: recipe for target 'all' failed make: *** [all] Error 2
    This is a known problem (see https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty). Reinstalling ca-certificates-java worked for me
    $ sudo dpkg --purge --force-depends ca-certificates-java
    $ sudo apt-get install ca-certificates-java
  4. The command make install gave permission errors. Changing it to sudo make install (assuming the user has sudo priviliges) works.

With these changes I was able to build and install.

Building cdds failed (Maven & Java version)

Hi,

I tried compiling the cdds.

Context :

Debian Buster GNU/linux

GCC : Debian 7.3.0-21
cmake : version 3.11.2
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"

Java :

openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-2-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

maven :

Apache Maven 3.5.3
Maven home: /usr/share/maven
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: fr_FR, platform encoding: UTF-8

but on make

[  1%] Building JAR file /..../cyclonedds/build/idlc/target/idlc-jar-with-dependencies.jar
---------------------------------------------------
constituent[0]: file:/usr/share/maven/conf/logging/
constituent[1]: file:/usr/share/maven/lib/maven-embedder-3.x.jar
constituent[2]: file:/usr/share/maven/lib/plexus-cipher.jar
constituent[3]: file:/usr/share/maven/lib/sisu-plexus.jar
constituent[4]: file:/usr/share/maven/lib/maven-model-builder-3.x.jar
constituent[5]: file:/usr/share/maven/lib/maven-compat-3.x.jar
constituent[6]: file:/usr/share/maven/lib/slf4j-api.jar
constituent[7]: file:/usr/share/maven/lib/aopalliance.jar
constituent[8]: file:/usr/share/maven/lib/maven-resolver-transport-wagon.jar
constituent[9]: file:/usr/share/maven/lib/maven-slf4j-provider-3.x.jar
constituent[10]: file:/usr/share/maven/lib/jsr250-api.jar
constituent[11]: file:/usr/share/maven/lib/maven-plugin-api-3.x.jar
constituent[12]: file:/usr/share/maven/lib/plexus-component-annotations.jar
constituent[13]: file:/usr/share/maven/lib/wagon-file.jar
constituent[14]: file:/usr/share/maven/lib/maven-builder-support-3.x.jar
constituent[15]: file:/usr/share/maven/lib/sisu-inject.jar
constituent[16]: file:/usr/share/maven/lib/commons-io.jar
constituent[17]: file:/usr/share/maven/lib/plexus-interpolation.jar
constituent[18]: file:/usr/share/maven/lib/maven-repository-metadata-3.x.jar
constituent[19]: file:/usr/share/maven/lib/maven-core-3.x.jar
constituent[20]: file:/usr/share/maven/lib/cdi-api.jar
constituent[21]: file:/usr/share/maven/lib/maven-resolver-impl.jar
constituent[22]: file:/usr/share/maven/lib/maven-resolver-util.jar
constituent[23]: file:/usr/share/maven/lib/plexus-utils.jar
constituent[24]: file:/usr/share/maven/lib/wagon-provider-api.jar
constituent[25]: file:/usr/share/maven/lib/maven-model-3.x.jar
constituent[26]: file:/usr/share/maven/lib/commons-cli.jar
constituent[27]: file:/usr/share/maven/lib/maven-settings-builder-3.x.jar
constituent[28]: file:/usr/share/maven/lib/plexus-sec-dispatcher.jar
constituent[29]: file:/usr/share/maven/lib/guava.jar
constituent[30]: file:/usr/share/maven/lib/maven-settings-3.x.jar
constituent[31]: file:/usr/share/maven/lib/commons-lang3.jar
constituent[32]: file:/usr/share/maven/lib/maven-shared-utils.jar
constituent[33]: file:/usr/share/maven/lib/jcl-over-slf4j.jar
constituent[34]: file:/usr/share/maven/lib/wagon-http-shaded.jar
constituent[35]: file:/usr/share/maven/lib/guice.jar
constituent[36]: file:/usr/share/maven/lib/maven-artifact-3.x.jar
constituent[37]: file:/usr/share/maven/lib/maven-resolver-provider-3.x.jar
constituent[38]: file:/usr/share/maven/lib/maven-resolver-api.jar
constituent[39]: file:/usr/share/maven/lib/jansi.jar
constituent[40]: file:/usr/share/maven/lib/maven-resolver-connector-basic.jar
constituent[41]: file:/usr/share/maven/lib/maven-resolver-spi.jar
constituent[42]: file:/usr/share/maven/lib/javax.inject.jar
---------------------------------------------------
Exception in thread "main" java.lang.NoSuchMethodError: java.nio.ByteBuffer.mark()Ljava/nio/ByteBuffer;
	at org.eclipse.aether.connector.basic.ChecksumCalculator.update(ChecksumCalculator.java:202)
	at org.eclipse.aether.connector.basic.TransferTransportListener.transportProgressed(TransferTransportListener.java:90)
	at org.eclipse.aether.transport.wagon.WagonTransferListener.transferProgress(WagonTransferListener.java:64)
	at org.apache.maven.wagon.events.TransferEventSupport.fireTransferProgress(TransferEventSupport.java:121)
	at org.apache.maven.wagon.AbstractWagon.fireTransferProgress(AbstractWagon.java:594)
	at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:579)
	at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:372)
	at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:315)
	at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:284)
	at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:97)
	at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
	at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:567)
	at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:435)
	at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:412)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:453)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:360)
	at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:583)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:259)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:498)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:261)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:253)
	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103)
	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:182)
	at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:286)
	at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:244)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:169)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:154)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:130)
	at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:144)
	at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:97)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:111)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
idlc/CMakeFiles/idlc.dir/build.make:160 : la recette pour la cible « idlc/target/idlc-jar-with-dependencies.jar » a échouée
make[2]: *** [idlc/target/idlc-jar-with-dependencies.jar] Erreur 1
CMakeFiles/Makefile2:85 : la recette pour la cible « idlc/CMakeFiles/idlc.dir/all » a échouée
make[1]: *** [idlc/CMakeFiles/idlc.dir/all] Erreur 2
Makefile:151 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

Compiler warning with g++ 7.3.0

On Ubuntu Bionic with g++ 7.3.0 the build has the following compiler warning:

In file included from /tmp/cyclonedds/src/os/src/posix/os_platform_stdlib.c:20:0:
/tmp/cyclonedds/src/os/src/posix/../snippets/code/os_stdlib_strtod.c: In function ‘os_lcNumericGet’:
/tmp/cyclonedds/src/os/src/posix/../snippets/code/os_stdlib_strtod.c:76:34: warning: ‘%3f’ directive output truncated writing 8 bytes into a region of size 4 [-Wformat-truncation=]
         (void) snprintf(num, 4, "%3f", 2.2);
                                  ^~~
/tmp/cyclonedds/src/os/src/posix/../snippets/code/os_stdlib_strtod.c:76:9: note: ‘snprintf’ output 9 bytes into a destination of size 4
         (void) snprintf(num, 4, "%3f", 2.2);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

While the current code tries to "truncate" the number to three characters that is not what %3f is doing. It only prints a minimum of three digits - it doesn't prevent decimal points to be printed. Based on that snprintf has to truncate the output to the buffer length (4 - 1) which results in a compiler warning with g++ (version 7.3.0 on Ubuntu Bionic) since the returned values isn't checked.

Functions in header files but missing in library .so

While generating the jna interface for java API we noticed that the following functions are defined in headers file but there are no corresponding symbols in libddsc.so :
dds_ssl_plugin
dds_durability_plugin
dds__builtin_participant_cb
dds__builtin_cmparticipant_cb
dds_set_allocator
dds_set_aligned_allocator
dds_rhc_add_waitset
dds_rhc_remove_waitset
dds_stream_from_buffer
dds_ssl_plugin
dds_durability_plugin
serdata_hash

ThroughputPublisher Termination

On MacOS (not verified if the same issue appears on Linux) a running instance of ThroughputPublisher cannot be terminated by Ctrl-C. It seams that the only way to stop it is to send a kill -9 signal.

Multi QueryConditions on one DataWriter

Hi, we are in the situation that one datareader needs different queryconditions on it to read different data samples with different keys. When one data sample(for example, key = i) comes, it will trigger its corresponding waitset that attach a querycondition(key == i).
When we test it on CycloneDDS, it seems Cyclone currently lacks support for this situation. When different queryconditions created simultaneously in different threads on one datareader, the waitset always return 0 without even reach the desiring wait time(it will return 0 as soon as dds_waitset_wait is executed). Even in one thread, when we create and delete queryconditions multi times, it may fail with the same result. Is it a bug or functions not supported yet?

CMake exits with an error message if a file does not contain any test signatures

When a source file passed to add_cunit_executable does not contain any test signatures, CMake exits with the following error:

CMake Error at cmake/modules/CUnit.cmake:177 (list):
  list sub-command REMOVE_DUPLICATES requires list to be present.
Call Stack (most recent call first):
  cmake/modules/CUnit.cmake:219 (process_cunit_source_file)
  os/tests/CMakeLists.txt:30 (add_cunit_executable)

idlc do not support IDL files with operations and attributes in a interface scope.

Hi, I have found that idlc do not support IDL files with operations and attributes in an interface scope. For the upper layer application (such as rpc) based on dds middleware we need to define the interface with operations and attributes in the IDL file. What should we do if I encounter this situation? Or should we enhance idlc support for interface statements?

dds_read_wl/dds_take_wl should allow to read/take all samples

dds_read_wl/dds_take_wl allows to read/take samples while loaning the memory that holds the samples themselves. However these APIs currently assume that the buf passed il pre-allocated to provide, say n slots. Why don't we allow this call to actually allocate buf when what is passed is a null pointer. We would have to change the signature, tu be able to return the newly allocated buffer, but at least we would make it possible to read all samples in one shot w/o having to issue multiple read/take and while still minimising the memory allocation.

@eboasson what are your thoughts?

A+

Lease duration QoS is ignored

As noted in #49, the value of the lease duration in the (participant) liveliness QoS is completely ignored and the actual lease duration is taken from the configuration file (Domain/Lease/ExpiryTime setting) instead. An argument can be made that a lease duration is a deployment setting and that a configuration file is a more appropriate place for it than a QoS setting, but to blatantly ignore the QoS setting is definitely not a good approach.

My initial thought is that taking the minimum of the QoS value and the configured would be a sensible approach, but I'd be interested in other people's opinions.

Userdata Qos usecase

Hello, I've been testing with userdata qos policy. The project currently has the ability to set the userdata qos. But how can a remote discovered participant get the qos policy I set before? Thanks!

Tests abort on windows when one the network interfaces is down

While trying to run the test cases on my laptop all tests that somehow use a network interface abort. The easiest way to reproduce is to simply run CUnit_os_getifaddrs_ipv4. The output I get is the following:

ctest -T test -C DEBUG -R CUnit_os_getifaddrs_ipv4 -V
UpdateCTestConfiguration  from :C:/cyclonedds/build.1/DartConfiguration.tcl
Parse Config file:C:/cyclonedds/build.1/DartConfiguration.tcl
   Site: DESKTOP-S7FK1CA
   Build name: Win32-MSBuild
UpdateCTestConfiguration  from :C:/cyclonedds/build.1/DartConfiguration.tcl
Parse Config file:C:/cyclonedds/build.1/DartConfiguration.tcl
Test project C:/cyclonedds/build.1
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 18
    Start 18: CUnit_os_getifaddrs_ipv4

18: Test command: C:\cyclonedds\build.1\bin\abstraction.exe "-a" "-r" "os_getifaddrs-ipv4" "-s" "os_getifaddrs" "-t" "ipv4"
18: Environment variables:
...
18: Test timeout computed to be: 10
18: Assertion failed: eq != 0, file c:\cyclonedds\src\os\src\windows\os_platform_ifaddrs.c, line 190
1/2 Test #18: CUnit_os_getifaddrs_ipv4 ..........***Failed    1.12 sec
test 22
    Start 22: CUnit_os_getifaddrs_ipv4_n_ipv6

22: Test command: C:\cyclonedds\build.1\bin\abstraction.exe "-a" "-r" "os_getifaddrs-ipv4_n_ipv6" "-s" "os_getifaddrs" "-t" "ipv4_n_ipv6"
22: Environment variables:
...
22: Test timeout computed to be: 10
22: Assertion failed: eq != 0, file c:\cyclonedds\src\os\src\windows\os_platform_ifaddrs.c, line 190
2/2 Test #22: CUnit_os_getifaddrs_ipv4_n_ipv6 ...***Failed    1.30 sec

0% tests passed, 2 tests failed out of 2

Total Test time (real) =   3.14 sec

The following tests FAILED:
         18 - CUnit_os_getifaddrs_ipv4 (Failed)
         22 - CUnit_os_getifaddrs_ipv4_n_ipv6 (Failed)
Errors while running CTest

Some question about qos

Hi,
If I want to test different qos, how can I find the difference? such as HISTORY kind.
In my test, I set history kind to KEEP_ALL for data writer. So WHC will keep all the values of instance, but when I test, the WHC will only keep 10 data samples.

Parameters of wrong type used for dds_delete and dds_entity_lock

In the file dds_entity.c on line 84 the parameter (e->m_hdl ) was provided to dds_entity_lock this parameter is of the type ( ut_handle_t) but a parameter of the type dds_entity_t is expected.
The same issue appears in the implementation of the function dds_delete_impl on line 373 ( (dds_delete(child->m_hdl) ).

Filtering self sent data

Hi,

When subscribing on a topic that the same participant is publishing to, how can one filter out the messages sent by this same participant. When searching on the internet regarding this topic, the only solutions that come up are to use the DDS_Entity API, which does not seem to be supported by Cyclone DDS.
See also: https://community.rti.com/kb/how-do-i-get-datareader-ignore-datawriter-belongs-same-domainparticipant

From dds_sample_info_t it is possible to access the field publication_handle of type dds_instance_handle_t but it seems this handle does not match the instance handle from the sending publisher or participant (gained by calling dds_get_instance_handle).

It seems the publication_handle is always 1 when the sender is receiving its own data, can this be relied upon as a workaround filtering criterion? Or is there a different API that can be used?

I would appreciate your help! Thanks,
Max

dds_rhc_take_w_qminv bug found

Hi, in dds_rhc_take_w_qminv function, a bug is found for taking samples with querycondition. If the sample you want to take is not the latest sample ([s1]-->[s2]-->[s3], if [s2] is desired by the querycondition), rhc will have difficulty to take it out simply because the iterating pointer is not updating in each while loop. To solve this problem, I update psample in each while iteration and it solves the problem. Can you have a look at it? Thanks!

 while (n_insts-- > 0 && n < max_samples)
    {
      struct rhc_instance * const inst1 = inst->next;
      iid = inst->iid;
      if (handle == DDS_HANDLE_NIL || iid == handle)
      {
        if (!INST_IS_EMPTY (inst) && (qmask_of_inst (inst) & qminv) == 0)
        {
          struct trigger_info pre, post;
          unsigned nvsamples = inst->nvsamples;
          const uint32_t n_first = n;
          get_trigger_info (&pre, inst, true);

          if (inst->latest)
          {
            struct rhc_sample * psample = inst->latest;
            struct rhc_sample * sample = psample->next;
            while (nvsamples--)
            {
              struct rhc_sample * const sample1 = sample->next;

              if ((QMASK_OF_SAMPLE (sample) & qminv) != 0)
              {
                psample = sample;
              }
              else
              {
                set_sample_info (info_seq + n, inst, sample);
                ddsi_serdata_to_sample (sample->sample, values[n], 0, 0);
                if (cond == NULL
                    || (dds_entity_kind(cond->m_entity.m_hdl) != DDS_KIND_COND_QUERY)
                    || ( cond->m_query.m_filter != NULL && cond->m_query.m_filter(cond->conds, values[n])))
                {
                  rhc->n_vsamples--;
                  if (sample->isread)
                  {
                    inst->nvread--;
                    rhc->n_vread--;
                  }

                  if (--inst->nvsamples > 0)
                  {
                    if (inst->latest == sample) {
                      inst->latest = psample;
                    }
                    psample->next = sample1;
                  }
                  else
                  {
                    inst->latest = NULL;
                  }
                  free_sample (inst, sample);
                  if (++n == max_samples)
                  {
                    break;
                  }
                }
                else
                {
                  /* The filter didn't match, so free the deserialised copy. */
                  ddsi_sertopic_free_sample (rhc->topic, values[n], DDS_FREE_CONTENTS);
                }
              }
              psample = sample;  //this line of code is added by me
              sample = sample1; 
            }
          }
`

About the formal release version

We want to introduce an light weight opensource DDS into out IOT project, so we compared some ones, FAST-RTPS,opensplice and cyclone.

FAST-RTPS is writen in C++, and used boost which we do not want to introduce into our project.
OpenSplice is complex and huge.
Cyclone seems meet our requirements, but Cyclone haven't a formal release version, that means it is not stable and we can not use it into our commercial project.
But we also found that, the former Issue said that, Cyclone will release its first version in Q1 of 2019. If this is ture, that will be fine, but if the first release version is too late, such as later than Q2, I think we should consider to make other plans.

Any way, I want to know the Cyclone's exact releasing time. Can you give us a more exact answer.

Setting an unsupported QoS should result in an error

Currently any valid QoS value is accepted by the implementation, regardless of whether it actually implements the behaviour. The result is confusion ...

It would be much better to reject any attempt at creating entities with unsupported QoS settings.

Question for reliable qos

Hi,
Recently I find something wired, I don't know whether it is a bug. Here is my test case(based on helloworld example):

  1. I set pub/sub qos as RELIABLE;
  2. I set pub/sub HISTORY qos as keep_all;
#pub
dwQos = dds_create_qos ();
dds_qset_reliability (dwQos, DDS_RELIABILITY_RELIABLE, DDS_SEC
dds_qset_history(dwQos, DDS_HISTORY_KEEP_ALL, 100);
writer = dds_create_writer (participant, topic, dwQos, NULL);
#sub
qos = dds_create_qos ();
dds_qset_reliability (qos, DDS_RELIABILITY_RELIABLE, DDS_SECS (10));
dds_qset_history(qos, DDS_HISTORY_KEEP_ALL, 100);
reader = dds_create_reader (participant, topic, qos, NULL);
  1. I restart sub several times and get next results:
    image

When the fist time I restart, it works good, but when I try second time restart, messages 3,4,5,6 again come, why this happen and what is ack message inside?

By the way, when I first time restart sub, it always works good.

Where is vortexddslauncher?

The documentation refers to the vortexddslauncher (and the presence of the launcher is also used by the fog05 config scripts, btw) but it looks likes this launcher is not part of Eclipse Cyclone DDS, or is it?

/cc @kydos

configurator issues

When trying to use the configurator (tools/config/cycloneddsconf.jar), a couple of issues were observed:

  1. the domainId 'any' isn't understood (it rejects non-integer values, needs updating to latest source)
  2. the 'internal' section is empty (needs to be generated from the doc's embedded in the sources)
  3. the default directory it opens to look for configs points to some opensplice-related directory (cause not investigated but 'smells' like its looking in the location pointed to by OSPL_URI)

What I'd suggest is:

  1. to include additional to 'cyclonedds.xml' also default configs for 1gpbs and 10gbps networks in the etc. directory (or use a config-directory under 'etc' as is common with other dds-products)
  2. once proper installers are available, it makes sense to set the CYCLONEDDS_URI environment variable to point to the 'cyclonedds.xml' file in that etc/[config] directory

non-blocking I/O on windows

The roundtrip test-app's on windows create 100% load on multiple threads, most easily to be observed when only starting the roundtripPong application and observing that without any traffic (no 'ping') it has 2 spinning threads

assert(0) in init_one_parameter function in q_plist.c

Hi, when I was using CycloneDDS, I found that the code could get into assert(0) in init_one_parameter in q_plist.c which shows it cannot happen.

02
01

image

When I check the code, I find that when pid equals 53701, it gets into if (pid & PID_UNRECOGNIZED_INCOMPATIBLE_FLAG) then runs into assert(0). Did you design it in that way or is this a bug?

compiling DDS with cmake 3.6.0-

Hi,
In my special linux, the repo only offers cmake 3.4, but it seems that CycloneDDS compiling requried cmake 3.6+ (claimed at the Readme.md).
So, i want to know what's the necessity. In another word, which features in the CMakefile.txt are advanced that only supported by cmake 3.6+.

Thanks a lot~~!

How network channel work

Hi,
As the code shows, TRANSPORT_PRIORITY will be implemented by NETWORK CHANNEL in the future. Can u explain how NETWORK CHANNEL works. Thanks a lot!

dds_take and dds_read looks completely same

Hello,

I noticed dds_read and dds_take are completely same. is this expected implementation?
Or forget to remove one side?
I'm confused when I reading example codes, one is using dds_read, one another is using dds_take

Thanks

A single function that deletes all participants in the process would be useful

Issue #12 came about because dds_fini looked like a function that could be called to simply clean up everything, which was more convenient than keeping track of the created participants and deleting them individually. Unfortunately, calling dds_fini had a slightly more complicated effect.

It probably would be a useful addition to have a function that deletes all participants that currently exist in the process (and that is a no-op if none exist).

Three major issues found for Cyclone.

Hello,
I have found three major issues for Cyclone till now.
1. Domain Id is restricted only to DDS_DOMAIN_DEFAULT. Different domain Ids (1~230) cannot be passed in which is different from the API description.
2. Get Instance handle is not supported for publisher, subscriber and topic.
3. StatusCondition seems not supported by Cyclone right now. So how can I wait for a certain status to be triggered using WaitSet?
Thanks!

How to use log function for cyclonedds?

Hi, I've been trying with log functions for cyclonedds. dds_public_log.h is included in my project, but when I use it nothing happens. How can I use it in a proper way? Thanks!

About the license

/*

As the code said, this project is licensed with epl-v2.0 or edl-v1.0.
But it seems that those two licenses have some conflict.
Such as the epl-v2.0 required all the modified code need to be open, but the edl-v1.0 does not have the requirement.

So if we import the Cyclone into our project, do we need to open all the code which we have modified.

Add 3rd party dependencies

Currently the repository in unbuildable due to missing 3rd party dependencies. Waiting for approval from Eclipse before adding them

Many sub and one pub

Hi,
I test the example HelloworldPublisher, if over 70 sub, but just one pub, many sub will not receive the message, what's the reason for this? and is there place to configure this

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.