-
Notifications
You must be signed in to change notification settings - Fork 450
Open
Labels
feature requestFeature request under evaluationFeature request under evaluation
Description
Brief feature description
For ease of use, it is desirable to run an iceoryx application without taking care whether the RouDi daemon is already running.
Detailed information
The RouDi daemon performs multiple tasks:
- setting up the shared memory segments
- creating resources for thing like publishers/subscribers
- monitoring and cleaning up memory if applications are not gracefully terminated
- providing a discovery service
Therefore it is required to be running when an iceoryx application is started.
For ease of use, it is desirable to run an iceoryx application without taking care whether the RouDi daemon is already running. There are multiple ways how this could be achieved
The user process forks a process for RouDi
- if there is already a running RouDi process the forked process silently exits
- once there are no more user processes left, RouDi shuts down
- in order to prevent a shutdown right at the start, when no user processes are registered, the forked RouDi knows the pid of it's child process and waits (with a timeout) for this process to register
- there is a race when RouDi shuts down and a new user process tries to for RouDi
- this might be solvable with a smart algorithm
- best place to do this might be were we currently check for a running RouDi
- this should be optional
- by compile time, e.g.
iox::runtime::PoshRuntime::initRuntime("app_name", iox::RouDi::TRY_FORK);oriox::roudi::RouDi::tryFork(); - by run time and environment variable, e.g.
export RUN_ROUDI_FROM_PATH=/home/foo/iox/build/iox-roudi; ./maypporRUN_ROUDI_FROM_PATH=/home/foo/iox/build/iox-roudi./maypp
- by compile time, e.g.
- how to deal with cmd line parameter
- each user process forwards the cmd line parameter to the forked RouDi process
- one does not know which RouDi wins the race when the cmd line parameter differ
- always use the default config file from /etc
- if a RouDi with different parameter is needed, it must be started manually
- it might be necessary to extend the config file with option for log level, etc.
- each user process forwards the cmd line parameter to the forked RouDi process
- when statically linked, each user process would be larger by a few MB due to the RouDi code
- this could be circumvented when the environment variable option is used
- forking would not be necessary anymore since we know the path to RouDi
- we could use the POSIX
systemfunction which should also work on Windows
- this could be circumvented when the environment variable option is used
Using a custom launcher like iox run myapp, similar to ros2 run foo_package bar
- this launcher start RouDi if it is not already running
- we could also extend the
ioxprocess with plugins likeiox list publisherfor the most simple form of introspection - harder to integrate in other frameworks like eCAL or ROS
- how it is done in ROS2
Use systemd as service manager
- similar to
iox run myappwithsystemclt start myapp.service - needs a service file
- would take care of starting RouDi and everything else which is needed by the application
- the systemd readiness protocol be implemented in iceoryx without directly linking to systemd libraries
- on macOS
launchdcould be used and Windows probably has something similar
Move RouDi (or parts of it) into a kernel module
- because we can
- might not work due to mapping of the shm, etc; we need to check this
- might reduce context switches
- might work on Linux and especially on QNX (microkernel)
- higher safety/security risk
- some of the safety guarantees from running as a user process are void
- would make RouDi probably harder to certify
budrus, ZhenshengLee and xixioba
Metadata
Metadata
Assignees
Labels
feature requestFeature request under evaluationFeature request under evaluation