-
Notifications
You must be signed in to change notification settings - Fork 40
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
[nexus][sled-agent] Try more to load firewall rules during service bringup #5054
Conversation
// Load as many services as we can, and don't exit immediately | ||
// upon failure... | ||
let load_services_result = | ||
self.inner.services.load_services().await.map_err(|err| { | ||
BackoffError::transient(Error::from(err)) | ||
}); | ||
|
||
// ... and request firewall rule updates for as many services as | ||
// we can. Note that we still make this request even if we only | ||
// partially load some services. | ||
let firewall_result = self | ||
.request_firewall_update() | ||
.await | ||
.map_err(|err| BackoffError::transient(err)) | ||
.map_err(|err| BackoffError::transient(err)); | ||
|
||
// Only complete if we have loaded all services and firewall | ||
// rules successfully. | ||
load_services_result.and(firewall_result) |
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.
By doing this operations back-to-back, we basically "load as many firewall rules as we can" for a set of services.
I could make this trigger more individually for "services which need firewall rules" (e.g., the request is only made after adding a Nexus / External DNS / boundary NTP zone), but felt that this was more "obviously not missing anything".
I could push down the triggers into the ServiceManager
if folks felt strongly about this.
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.
Hmm, like this we'll continue to hit the endpoint if we get stuck in the disk error loop right? Wonder if cause any issues constantly trying to update fw rules. Oh but there's the backoff in the retry loop. So, should be fine
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.
Thanks for putting this together so quick Sean!
// Load as many services as we can, and don't exit immediately | ||
// upon failure... | ||
let load_services_result = | ||
self.inner.services.load_services().await.map_err(|err| { | ||
BackoffError::transient(Error::from(err)) | ||
}); | ||
|
||
// ... and request firewall rule updates for as many services as | ||
// we can. Note that we still make this request even if we only | ||
// partially load some services. | ||
let firewall_result = self | ||
.request_firewall_update() | ||
.await | ||
.map_err(|err| BackoffError::transient(err)) | ||
.map_err(|err| BackoffError::transient(err)); | ||
|
||
// Only complete if we have loaded all services and firewall | ||
// rules successfully. | ||
load_services_result.and(firewall_result) |
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.
Hmm, like this we'll continue to hit the endpoint if we get stuck in the disk error loop right? Wonder if cause any issues constantly trying to update fw rules. Oh but there's the backoff in the retry loop. So, should be fine
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.
Thanks for the very quick turnaround! This looks about right to me from what we talked over.
Fixes #5053 , with this solution implemented:
I used a bit of a brute-force solution here -- "just do it each time we try to launch a set of zones". This could certainly be more fine-grained, but it gets the job done.