Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
broker: various cleanup + refactoring #2194
While PR #2181 is still half fresh in my mind, wanted to do these small cleanups & refactorings.
Obviously, way more refactoring can be done as I've listed things in #2182, but this is more of a refactoring "setup" for bigger things later.
Mostly small changes to slowly decouple objects from each other or clarify lack of dependency between objects.
Also, removed a few more
Move estimation of shutdown grace period into shutdown object with new function shutdown_set_grace(). With this setting, grace period no longer needs to be set via shutdown_arm(), thus the grace parameter is no longer needed in that function. Update tests appropriately.
Remove function heartbeat_set_ratestr(). Instead, broker will parse command-line input from user and set via heartbeat_set_rate(). This change removes the heartbeat object as a dependency for parsing commandline arguments. Update tests accordingly.
Move the zsecurity context from the broker context to the overlay object. It is only used inside the overlay and does not need to be depended on by the broker ctx.
Move sigwatchers list into broker context. Instead of calling broker_unhandle_signals() on cleanup, simply set free function on each element of sigwatchers list.
Do not "manually" cleanup up subscriptions list. Simply set a free function after each append to the subscriptions list.
Have overlay init cb return an int for success/fail. Have this value be returnable by overlay_init(), which can be returned by boot_pmi() and boot_config().
Move all "register_attrs" calls to a location closer to the initialization / setup of other parts of the object. With this change, the register_attrs calls are more in line with their object and removes the impression that the registering of the attrs needs to be done in a specific order except for when commented. The movement of content_cache_register_attrs() effectively reverses commit 3d59fbf which was a fix for #1063. The fix of issue #1036 no longer requires the content_cache_register_attrs() call to be made far earlier in the code before zsys_init().
Hm, in the valgrind test we adjust the broker's "shutdown-grace" period, but not flux-start's