Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve PSMX a bit: multiple plugins, interface improvements, documentation #2158

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

eboasson
Copy link
Contributor

... and some odds and ends ...

I'm happy to move the odds-and-ends into a separate PR if people want me to, it's just that I think they are some trivial things I came across while doing this.

eboasson and others added 9 commits January 14, 2025 13:11
The auto-reset timed callback handler calls ddsi_delete_xevent to delete the event, but
this deadlocks if the deletion of the event is synchronized with the execution of the
handler. Since this is a fire-and-forget event, not synchronizing it is the sensible thing
to do.

Signed-off-by: Erik Boasson <[email protected]>
* enable entity creation with multiple psmx

* Multi psmx (eclipse-cyclonedds#30)

* Bug fixes in psmx instances QoS policy

Fixed wrong psmx instance name being "found"
Completed cleanup of returned heap memory, early exit in loop
skipped some of it

* Added dds_psmx_get_config_option_value

This function returns the psmx configuration string's option value
if it contains any
This function is used in multiple PSMX interfaces, so making it
a part of the dds psmx interface toolkit seemed like a good idea

* Implemented multi-psmx write path

Rewrote tests to acccount for multi-psmx
Added real loans to dummy psmx library, since the writes are
now done in earnest
Added tests to check for multi-psmx

* Changes due to github comments

Changed ordering of parameters in copy function
Added documentation of dds_loaned_sample_copy function
Made variable declarations more legible

* Additional fixes

Fixed psmx instance id calculation: using the service name in stead
of the config name
Re-enabled fastpath delivery when psmx is present, added dropping of
samples received from psmx writers in the same presence

* Additional fixes due to github comments

* Fix for unittests

Zerocopy needed changing as local delivery now no longer goes
through psmx
cunit-psmx-one-writer fastpath-hack did not work for psmx interfaces

* Additional fixes due to github comments

Missed cleanup of heap memory in psmx_instance_load happy path

* Fix memory leak, use-after-free and incorrect loan allocation in dummy plugin

* Fix use-after-free in deletion of writer that has loans

Co-authored-by: Michel van den Hoek <[email protected]>
Co-authored-by: reicheratwork <[email protected]>
Co-authored-by: Dennis Potman <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
The GUID is typed as a "dds_guid_t", which is the array of 16 octets that the entire world
uses, but it a copy of the "ddsi_guid_t" used nearly everywhere internally, which
interprets it as 4 32-bit ints in native-endianness.  That means it is not as one would
expect on a little-endian machine.

It all cancelled out nicely if all machines involved in a PSMX domain have the same
endianness (which in the case of the dummy plugin, the Cyclone DDS-based one and the
Iceoryx one is self-evidently the case).

Signed-off-by: Erik Boasson <[email protected]>
This provides a uniform way for accessing the name in the plugin.

Signed-off-by: Erik Boasson <[email protected]>
This should follow the same syntax rules as the config string checker.

Signed-off-by: Erik Boasson <[email protected]>
There is no point in exporting this: a plugin knows its own features; an application can't
get hold of the argument that the function requires.

Signed-off-by: Erik Boasson <[email protected]>
This adds (in source and binary backwards compatible fashion) alternative functions to the
PSMX interface for:

* creating topics with full type information (if the information is available), as the
  well is the in-memory size of the type for use with transports that require the message
  size to be known when an endpoint is created;

* writing data with a serialized key blob as an additional parameter, for cases where the
  transport needs to know the actual key value.

It also cleans up the somewhat weird constructor/destructor rules with functions that have
to be called, and turns functions that were required to be called for no reason whatsoever
into no-ops.

If the old function pointers of a PSMX plugin for creating a topic and deinitializing a
PSMX instance are provided, it is considered to implement the old interface and the
expects aforementioned weird rules to be followed.  If instead they are set to null
pointers, then the new ones must be provided and the plugin is considered to implement the
new interface.

Furthermore, detailed documentation for the PSMX interface (old and new) is now present.

Signed-off-by: Erik Boasson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant