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

flow.cfg: In Config_manager doc header suggest a strategy for applications for handling dynamic update requests. #73

Open
ygoldfeld opened this issue Mar 10, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source

Comments

@ygoldfeld
Copy link
Contributor

ygoldfeld commented Mar 10, 2024

Filed by @ygoldfeld pre-open-source:

Class template Config_manager doc header has a section "Relationship with the rest of your program/threads."

It should suggest an ordering of things. Something like:

  • Make a class Updater which reacts to signals/requests/etc. to read dynamic update file D.
  • In your application:
    ** Create Updater. Have it read baseline (apply_static_and_dynamic(B)) from file B; and possibly initial-dynamic (apply_dynamic(D)) from file D.
    ** Create and start each module M. Before M starts its threads, it must register_dynamic_change_listener() if relevant. Inside this listener, usually, true handling would be post()ed onto M's threads.
    ** Start Updater thread. When update signal comes in, call apply_dynamic(D) from that thread.
    ** SIGTERM/etc. happens. Then:
    ** Stop Updater thread. Once it is stopped, proceed:
    ** Stop each module M (stop its threads).
    ** Destroy modules M.
    ** Destroy Updater.
  • The key is:
    ** Registration of listeners occurs before Updater can apply_dynamic().
    ** Listeners and their owners are fully alive until after the very last moment apply_dynamic() can still be called.
    ** Explicit unregistration of listeners is not necessary.
    ** Startup and shutdown are symmetrical.

Also, look through suggestions in existing comments about when to call unregister...(); it says stuff about "SHOULD" which is not really consistent with the above.

Lastly, make some suggestions about:

  • Feature: Backup last-known-good file D.
  • Feature: Crash rejection.
@ygoldfeld ygoldfeld added enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source documentation Improvements or additions to documentation labels Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request from-akamai-pre-open Issue origin is Akamai, before opening source
Projects
None yet
Development

No branches or pull requests

1 participant