-
Notifications
You must be signed in to change notification settings - Fork 49
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
broker: refactoring / cleanup #2182
Comments
|
|
|
|
|
|
A lot of work has been done in the broker over the intervening years, my guess a lot of these specific examples and the more generic issue of "refactor / cleanup the broker" no longer applies. Can we close this issue? Specific cleanup or refactoring issues could be introduced in individual issues if they still apply. |
yeah, lets close. |
While working on #1036 (PR #2181), some of the broker code was a little tricky and could use some cleanup/refactoring. I can't exactly see the best way to do it, but just writing down some thoughts/ideas before I forget them. I will add more as I come up on it
but there are a lot of interdependencies between things in the broker which made this hard. While some of this is probably unavoidable, I think some could be made simpler by combining the
create
andinit
functions into one, or removingstop
orunregister
or similar functions and put them intodestroy
.For example, I don't think:
and then later
is necessary. It could just be a single
publisher_create()
call that gets initialized with the right stuff. Not sure how many can be done this way. I thinkattrs_create()
andinit_attrs()
can probably be combined. And probablyheartbeat_set_flux()
andheartbeat_stop()
isn't necessary either.There is some ordering to calls that is important that is not initially obvious. The "register_attrs" calls are in different locations for example (one due to t2008-althash.t errors #1063). I'm not entirely sure what could be done here. Perhaps internally in the
attr
library, it could recognize settings via the command line having "precedence", thus the ordering of the "register_attrs" calls is no longer important.the
sigwatchers
list and signal handling could probably be abstracted away into a "class" (maybe the signal masking too).the
shutdown_grace
is initialized at a random point in the middle after overlay setup. Perhaps could be abstracted away inside theshutdown
"class" (combined with part 1 above, where it's initialized at creation of the shutdown object) (Edit: Generically, move initialization / settings into the "objects". runlevel rc config another possible example). (Edit,shutdown_grace
specifically handled in broker: various cleanup + refactoring #2194).The text was updated successfully, but these errors were encountered: