Coder Social home page Coder Social logo

Comments (4)

kozakusek avatar kozakusek commented on July 18, 2024 1

Thanks for the explanation and bringing up the issues that might arise from this change.
I will try the Node API and if it doesn't work out I will just think of some local workarounds.

from iceoryx.

elBoberido avatar elBoberido commented on July 18, 2024

@kozakusek can you share some details of your use case?

The experimental Node API might be interesting for you

This API does not use a static runtime and when the Node is destroyed (all endpoints need to be destroyed beforehand) it de-registers from RouDi and RouDi can be shut down. Later you can re-start RouDi and create new nodes.

Currently, only Publisher, Subscriber and the WaitSet is available with the experimental API. If you also need Server, Client and Listener, it isn't too complicated to add them. You can either try to add it yourself, wait till someone else implements it (it is on my quite long todo list) or ask these new guyes from ekxide to do it ;)

from iceoryx.

kozakusek avatar kozakusek commented on July 18, 2024

I have long running processes (days+) that might only want to communicate during start-up (or some catch-up) and basically go on with their life. In the meantime I want to restart the daemon to for example change the config.

The other thing: I want to have different roudi configs for different tests in one junit suite..

Those are not major issues, however the flag whould be a nice thing to have, especially when there is already a filed in the config that allows this behaviour

from iceoryx.

elBoberido avatar elBoberido commented on July 18, 2024

In this case the new experimental API is exactly what you need. You can shut down RouDi once all the nodes are destructed, restart RouDi with a different config and create new nodes to connect to the new RouDi. While multiple RouDi can run in parallel, it is not yet possible to have nodes connected to multiple RouDis in the same process at the same time. This is only possible in tests. Here you can check how to use multiple RouDi in the tests.
https://github.com/eclipse-iceoryx/iceoryx/blob/master/iceoryx_posh/test/integrationtests/test_posh_experimental_node.cpp#L570

I don't like to expose this option to the default RouDi since it only partially does what you need and it might result in unexpected behavior. For example, if you would restart RouDi and run a process which wants to subscribe to a publisher which was started with the previous RouDi, this would not be possible, leaving the users confused and finally bug tickets would appear on this repo.

Furthermore, since the long running process would not destruct the static runtime, the shared memory would not be released since there are still open file descriptors. The files in /dev/shm will be removed but the memory will not be obtained. You can test this with pkill -9 iox-roudi and deleting all iox_ files from /dev/shm while your process is running. The communication via iceoryx continuous to work, one just cannot subscribe to or unsubscribe from existing connections but allocating chunks and publishing still works. This means you would run out of memory sooner or later since the runtimes keep the memory mapped.

If you do not know when all nodes would be destroyed and therefore also not when to stop RouDi, there are multiple options

  • monitoring app
    • subscribe to the process introspection topic
    • when there are no other processes listed except roudi and your monitoring app, destruct the node in the monitoring app
    • send a sigterm to the RouDi PID
  • add option to let RouDi shut down automatically once the last process unregisters
    • in #970 we had the idea to let applications start RouDi if it is not running and RouDi would shut down when there are no registered processes are left
    • this would be the ideal solution and also should not take too much time to implement

from iceoryx.

Related Issues (20)

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.