Commit graph

1078 commits

Author SHA1 Message Date
Erik Boasson
3faf5f45f6 enable expensive checks in CI builds
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
fcb6b935ea support for building/running on OpenIndiana
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
7540ac8229 make expensive checks in asserts optional (#125)
This adds an Internal/EnableExpensiveChecks setting for enabling some or all expensive run-time checks to avoid a massive slowdown when assertions are enabled at compile-time. Currently these cover only the writer and reader-history cache checking.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
a39701fc2e allow configuration input (typically CYCLONEDDS_URI) to include XML fragments
The configuration handling already allowed specifying multiple files in CYCLONEDDS_URI to be read in-order, this extends the behaviour to also allow the contents of these files to be embedded. This makes it possible to set a configuration without requiring a file system, or to add some ad-hoc options.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
15a3d7d3ad make it possible to retrieve buffer position after parsing XML
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
f65d07fb14 give XML parser an option to ignore junk at the end
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
431f70a2e9 only IPv4 has a netmask and fix IPv6 on Windows
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
c39cc74e13 using explicit fflush instead of setvbuf (#133)
Because line-buffering doesn't exist on Windows ...

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
Erik Boasson
959a096372 make timeout argument in ping work again (#126)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-23 15:40:29 +01:00
eboasson
623b35d83b
Merge pull request #124 from k0ekk0ek/ddsrt
Reorganize and clean up abstraction layer

The include files have moved from the (somewhat illogical) ``include/ddsc`` to the more logical ``include/dds``. To avoid breaking existing code, a ``include/ddsc/dds.h`` is added that simply includes the one in the new location.
2019-03-23 15:38:55 +01:00
Jeroen Koekkoek
cd6742ee12 Rearrange and fixup abstraction layer
- Replace os_result by dds_retcode_t and move DDS return code defines down.
  Eliminates the need to convert between different return code types.

- Move dds_time_t down and remove os_time.
  Eliminates the need to convert between different time representations and
  reduces code duplication.

- Remove use of Microsoft source-code annotation language (SAL).
  SAL annotations are Microsoft specific and not very well documented. This
  makes it very difficult for contributers to write.

- Rearrange the abstraction layer to be feature-based. The previous layout
  falsely assumed that the operating system dictates which implementation is
  best suited. For general purpose operating systems this is mostly true, but
  embedded targets require a slightly different approach and may not even offer
  all features. The new layout makes it possible to mix-and-match feature
  implementations and allows for features to not be implemented at all.

- Replace the os prefix by ddsrt to avoid name collisions.

- Remove various portions of unused and unwanted code.

- Export thread names on all supported platforms.

- Return native thread identifier on POSIX compatible platforms.

- Add timed wait for condition variables that takes an absolute time.

- Remove system abstraction for errno. The os_getErrno and os_setErrno were
  incorrect. Functions that might fail now simply return a DDS return code
  instead.

- Remove thread-specific memory abstraction. os_threadMemGet and accompanying
  functions were a mess and their use has been eliminated by other changes in
  this commit.

- Replace attribute (re)defines by ddsrt_ prefixed equivalents to avoid name
  collisions and problems with faulty __nonnull__ attributes.

Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-03-22 15:19:09 +01:00
eboasson
318968f40f
Merge pull request #129 from eboasson/master
Writer throttling fixes + timeouts on Windows
2019-03-19 09:42:19 +01:00
Erik Boasson
aa6a6442c2 Fix conversion of {sec,nsec} to msec in timedwait on Windows
Internally time stamps and durations are all in nanoseconds, but the
platform abstraction uses {sec,nsec} (essentially a struct timespec) and
Windows uses milliseconds.  The conversion to milliseconds with upwards
rounding was broken, adding ~1s to each timeout.  In most of the handful
of uses the effect is minor in practice, but it does matter a lot in the
scheduling of Heartbeat and AckNack messages, e.g., by causing a simple
throughput test to exhibit periodic drops in throughput.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-16 20:47:59 +01:00
Erik Boasson
2e9685221a Recheck WHC for unacked data just before blocking
A writer blocking on a full WHC will still send out whatever it has
buffered but not sent yet. For this, the writer lock must be released,
but that means an ACK can sneak in between sending out the packet and
relocking the writer (not likely if there's a real network in between,
but over a loopback interface it is definitely possible).

Therefore, the amount of unacknowledged data that controls the blocking
and triggering of it must be refreshed before deciding to block,
otherwise it may hang indefinitely.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-15 15:17:52 +01:00
Erik Boasson
9743bda57b Count concurrent calls blocking on a full WHC
The writer tracks whether it is throttled because of a full WHC, but
does so by treating it as a simple flag.  This is fine if there is at
most one thread blocked on any single writer at any time, but if there
are multiple threads using the same writer it would be possible for one
thread to be woken up, clear the flag, and so affect the wakeup of other
threads.

Turning it from a flag to a counter avoids that problem.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-03-15 15:17:52 +01:00
eboasson
f997972ec7
Merge pull request #127 from k0ekk0ek/noiolbf
Disable line buffering in Throughput examples on Windows
2019-03-14 11:52:33 +01:00
Jeroen Koekkoek
1e1e9987bc Disable line buffering in Throughput examples on Windows
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-03-08 15:13:09 +01:00
eboasson
1c7f903546
Merge pull request #115 from k0ekk0ek/travisci
Windows builds on Travis CI
2019-02-19 09:27:17 +00:00
Jeroen Koekkoek
58a8dfd5c5 Add support for Travis CI Windows builds
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-02-18 14:14:24 +01:00
Jeroen Koekkoek
1d923764e1 Fix IDL Compiler invocation on Windows
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-02-18 13:51:08 +01:00
Jeroen Koekkoek
86d3972ad9 Fix FindMaven.cmake on Windows
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-02-18 13:50:25 +01:00
eboasson
a54ebff1c3
Merge pull request #114 from eboasson/cross-i-dot-t
Dotting i's and crossing t's for a 0.1.0 release
2019-02-17 10:37:57 +00:00
Erik Boasson
6aa88a4823 Editing of README and next-steps following review comments
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-16 08:54:17 +01:00
Erik Boasson
3acabf23a5 address false positive from gcc in snprintf usage
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 16:23:43 +01:00
Erik Boasson
e54b9ec715 update README prerequisites and build info
The build information in the README was very limited (now it is less
limited) and, the list of prerequisites was incomplete, documentation
link was out of date ...  This cleans it up a bit.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 16:20:40 +01:00
Erik Boasson
76ca027340 cmake 3.6 bugs out over cunit, so move to 3.7
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 16:19:36 +01:00
Erik Boasson
c7906f296d consistently use Eclipse Cyclone DDS in documentation
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
Erik Boasson
753f910aad consistently use Eclipse Cyclone DDS in API header files
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
Erik Boasson
c10a52c494 change meaningless "ospl_" prefix on configuration structures to "config_"
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
Erik Boasson
707045256a update configurator input file (#38)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
Erik Boasson
4f59df2451 remove left-over support for commercial variants from configuration editing tool
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
Erik Boasson
164763e13c remove copyright blurbs from output of IDL preprocessor
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
Erik Boasson
e72c7e9194 remove left-over licensing support code from IDL preprocessor
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
Erik Boasson
01bd75b7a5 remove invalid copyright claim on an otherwise unmodified file
An additional copyright header was added to an otherwise unmodified source file, and that is not allowed.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-15 11:35:00 +01:00
eboasson
bfe1221138
Merge pull request #111 from eboasson/fix-87
Add support for query conditions
2019-02-13 09:37:04 +00:00
Erik Boasson
1c963b5c3b add torture test for read, query conditions
The "rhc" test runs a random sequence of operations (writes, reads, &c.)
through an RHC with conditions attached to it.  All possible state masks
are used, and query conditions are tried with a condition that only
tests the key value, and one that tests attribute values.  It depends on
the internal checking logic of the RHC, which is currently enabled only
in Debug builds because of the associated run-time overhead.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-12 14:22:06 +01:00
Erik Boasson
a1e827cf7e minor improvements to query condition handling
Various details:
- index replaced throughout by bitmask
- caching a single sample in RHC for deserialising samples when query conditions are used
- short-circuiting the trivial case of an instance matched neither before nor after a change to its state
- combining inc/dec counters into a single delta in condition evaluation
- major speed-up of rhc_check_counts by not checking the condition bit masks every single time

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-11 15:56:58 +01:00
Erik Boasson
96649c435d always zero out non-key fields in invalid samples returned by read/take
The specification says the data in an invalid sample must not be inspected, but that means retrieving the key values from a disposed/unregistered instance after a take is impossible. So, the elegant thing to do is to always provide the key values in the data. The remaining question is then whether the non-key fields should be left in whatever state they happened to be in, or be set to zero. The latter is more consistent in the interface, and that is almost invariably a good thing.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-11 11:12:07 +01:00
Erik Boasson
f0675ca7f1 support for query conditions
This also fixes #87.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-11 11:12:07 +01:00
Erik Boasson
b21c7f032c set masks in samples/instances for query conditions
Whenever a sample or an instance is added, check it against the attached query conditions and indicate which ones match

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 19:19:41 +01:00
Erik Boasson
796f6860c7 add missing braces to initializers for vendor ids
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 19:19:41 +01:00
Erik Boasson
7739341e71 some errors on locking entities are not worth logging
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 18:23:51 +01:00
Erik Boasson
eee8f6cc59 assign an index to query conditions
This index can then be used as an index into a bitmap to keep track
which query conditions are matched by a sample or an instance.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 18:23:51 +01:00
Erik Boasson
1d746a866d remove unused conds_lock from RHC
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 18:23:51 +01:00
Erik Boasson
de5021dc55 change initialisation of a read condition to set the query condition as well
The read condition and the query condition are represented by the same data type internally, and a read condition therefore has a "m_filter" attribute. It makes more sense to initialise this properly as part of the read condition, instead of initialisation-by-memset in the dds_create_readcond, then overwriting it in dds_create_querycond.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 18:23:51 +01:00
Erik Boasson
fcdffa8cf8 add a separate RHC tracing category
The RHC tracing produces so much junk that is hardly ever useful that a
normal trace should definitely not include it.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 18:23:51 +01:00
Erik Boasson
e0e1e67f24 read condition on view "old" not triggered when reading only "read" samples
A read restricted to samples in "read" state would not enter the condition update code on the false assumption that no read conditions could become triggered if the number of read samples remained the same, but it is nonetheless possible that the instance was transitions from "new" to "old" as a consequence, at least in my interpretation of the spec and the current implementation of read() in Cyclone. This commit brings consistency to the implementation without the intention of confirming the current behaviour as being desirable.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 18:23:51 +01:00
Erik Boasson
6646a766c5 fixup following rename SYSDEPS to OS_MSGHDR_FLAGS
The name change missed the uses of the macro, with the result that
datagram truncation on reception does not result in warning (but in
the default configuration, truncation cannot occur); and that the
message flags are undefined on sending datagrams, but judging by the
man page, the likelihood of this causing problems is also small in
practice.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-10 08:30:39 +00:00
eboasson
4046c6fff8
Merge pull request #109 from eboasson/master
start using the DDSI vendor id code for the Eclipse Foundation
2019-02-08 11:21:22 +00:00
Erik Boasson
98465035e6 start using the DDSI vendor id code for the Eclipse Foundation
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-02-07 12:23:01 +01:00