-
Notifications
You must be signed in to change notification settings - Fork 315
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
Refactor discovery system #29
Conversation
pub struct CensusEntry { | ||
id: Uuid, | ||
hostname: String, | ||
ip: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to consider using the SocketAddrV4
struct instead of a string representation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's stringy because it's only real purpose in life is to be serialized. I haven't looked at whether the actual socket types serialize into something useful, in terms of how you write configuration templates.
@adamhjk this is a massive improvement and exactly in line with what I expected/hoped for. Things are very much easier to understand and work with after this PR. A few minor overall notes:
|
I'm going to have another PR soon with updated docs. I didn't want to block on it, since the cahnge was already so massive that it's a merge-nightmare waiting to happen for you and fletcher. I'll add license files as well as a few cleanups you suggested. Nice review! |
@adamhjk sounds great to me 😄 |
* Adds the Census for global coordination * Topologies now use the Census rather than discovery directly * Configuration loading moved to the servic_config module * Main event loop now processes more things between states; config updates, census updates, process restarting. * Watches are now universally supported. * Standalone topology now mocks etcd * No longer depends on inotify, several other crates * No longer restarts a service if the toml has changed but the configuration files are identical * No more need for the 'toml' directory * last.toml renamed config.toml * Adds missing license headers And more! Think of the glorious future!
This PR has passed 'Verify' and is ready for review and approval! |
CensusEntry { | ||
id: Uuid::new_v4(), | ||
hostname: util::sys::hostname().unwrap_or(String::from("unknown")), | ||
ip: util::sys::ip().unwrap_or(String::from("127.0.0.1")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, Ohai in Rust would be crazy nice if there's more like this around…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dude, I was talking to @jtimberman tonight and we got on a tangent but I was about to tell him all about how Ohai is great but the worst part about it is that it's not a systems app and it requires Ruby. There's a version of Ohai that exists which leverages a proper systems level language and real-time updates servers as we go - I know it.
@delivery approve |
Merged change 3742a92a-7588-403e-b33e-18934930a5e6 From review branch BLDR-20 into master Signed-off-by: fnichol <[email protected]>
Change: 3742a92a-7588-403e-b33e-18934930a5e6 approved by: @fnichol |
suitability: u64, | ||
port: Option<String>, | ||
exposes: Option<Vec<String>>, | ||
pub leader: Option<bool>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these pub
to get the reader benefit? I would think we'd want any mutation to happen via fn leader(…)
(etc.), correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, reader.
} | ||
HandleResult::Reply(Message::Ok, Some(ENTRY_TIMEOUT_MS)) | ||
}, | ||
Message::Ok => HandleResult::Stop(StopReason::Fatal(format!("You don't send me Ok! I send YOU Ok!")), Some(Message::Ok)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enums and match in action, nice
This PR has passed 'Acceptance' and is ready to be delivered! |
@adamhjk awesome work in this pr! |
updates, census updates, process restarting.
configuration files are identical
And more! Think of the glorious future!